all: chase hyprland

This commit is contained in:
Vaxry 2024-05-08 13:48:33 +01:00
parent d716d12213
commit dcbdc9a08d
3 changed files with 36 additions and 36 deletions

View file

@ -36,36 +36,36 @@ class CHyprBar : public IHyprWindowDecoration {
void setHidden(bool hidden); void setHidden(bool hidden);
private: private:
SWindowDecorationExtents m_seExtents; SWindowDecorationExtents m_seExtents;
PHLWINDOWREF m_pWindow; PHLWINDOWREF m_pWindow;
CBox m_bAssignedBox; CBox m_bAssignedBox;
CTexture m_tTextTex; CTexture m_tTextTex;
CTexture m_tButtonsTex; CTexture m_tButtonsTex;
bool m_bWindowSizeChanged = false; bool m_bWindowSizeChanged = false;
bool m_bHidden = false; bool m_bHidden = false;
Vector2D cursorRelativeToBar(); Vector2D cursorRelativeToBar();
void renderBarTitle(const Vector2D& bufferSize, const float scale); void renderBarTitle(const Vector2D& bufferSize, const float scale);
void renderText(CTexture& out, const std::string& text, const CColor& color, const Vector2D& bufferSize, const float scale, const int fontSize); void renderText(CTexture& out, const std::string& text, const CColor& color, const Vector2D& bufferSize, const float scale, const int fontSize);
void renderBarButtons(const Vector2D& bufferSize, const float scale); void renderBarButtons(const Vector2D& bufferSize, const float scale);
void renderBarButtonsText(CBox* barBox, const float scale, const float a); void renderBarButtonsText(CBox* barBox, const float scale, const float a);
void onMouseDown(SCallbackInfo& info, wlr_pointer_button_event* e); void onMouseDown(SCallbackInfo& info, wlr_pointer_button_event* e);
void onMouseMove(Vector2D coords); void onMouseMove(Vector2D coords);
CBox assignedBoxGlobal(); CBox assignedBoxGlobal();
std::shared_ptr<HOOK_CALLBACK_FN> m_pMouseButtonCallback; SP<HOOK_CALLBACK_FN> m_pMouseButtonCallback;
std::shared_ptr<HOOK_CALLBACK_FN> m_pMouseMoveCallback; SP<HOOK_CALLBACK_FN> m_pMouseMoveCallback;
std::string m_szLastTitle; std::string m_szLastTitle;
bool m_bDraggingThis = false; bool m_bDraggingThis = false;
bool m_bDragPending = false; bool m_bDragPending = false;
bool m_bCancelledDown = false; bool m_bCancelledDown = false;
// for dynamic updates // for dynamic updates
int m_iLastHeight = 0; int m_iLastHeight = 0;

View file

@ -54,27 +54,27 @@ class COverview {
CBox box; CBox box;
}; };
Vector2D lastMousePosLocal = Vector2D{}; Vector2D lastMousePosLocal = Vector2D{};
int openedID = -1; int openedID = -1;
int closeOnID = -1; int closeOnID = -1;
std::vector<SWorkspaceImage> images; std::vector<SWorkspaceImage> images;
PHLWORKSPACE startedOn; PHLWORKSPACE startedOn;
CAnimatedVariable<Vector2D> size; CAnimatedVariable<Vector2D> size;
CAnimatedVariable<Vector2D> pos; CAnimatedVariable<Vector2D> pos;
bool closing = false; bool closing = false;
std::shared_ptr<HOOK_CALLBACK_FN> mouseMoveHook; SP<HOOK_CALLBACK_FN> mouseMoveHook;
std::shared_ptr<HOOK_CALLBACK_FN> mouseButtonHook; SP<HOOK_CALLBACK_FN> mouseButtonHook;
std::shared_ptr<HOOK_CALLBACK_FN> touchMoveHook; SP<HOOK_CALLBACK_FN> touchMoveHook;
std::shared_ptr<HOOK_CALLBACK_FN> touchUpHook; SP<HOOK_CALLBACK_FN> touchUpHook;
bool swipe = false; bool swipe = false;
bool swipeWasCommenced = false; bool swipeWasCommenced = false;
}; };
inline std::unique_ptr<COverview> g_pOverview; inline std::unique_ptr<COverview> g_pOverview;

View file

@ -46,7 +46,7 @@ class CTrail : public IHyprWindowDecoration {
virtual void damageEntire(); virtual void damageEntire();
private: private:
std::shared_ptr<HOOK_CALLBACK_FN> pTickCb; SP<HOOK_CALLBACK_FN> pTickCb;
void onTick(); void onTick();
std::deque<std::pair<box, std::chrono::system_clock::time_point>> m_dLastGeoms; std::deque<std::pair<box, std::chrono::system_clock::time_point>> m_dLastGeoms;