diff --git a/hyprbars/barDeco.cpp b/hyprbars/barDeco.cpp index 19a76ff..a2007ea 100644 --- a/hyprbars/barDeco.cpp +++ b/hyprbars/barDeco.cpp @@ -13,7 +13,7 @@ CHyprBar::CHyprBar(PHLWINDOW pWindow) : IHyprWindowDecoration(pWindow) { PMONITOR->scheduledRecalc = true; m_pMouseButtonCallback = HyprlandAPI::registerCallbackDynamic( - PHANDLE, "mouseButton", [&](void* self, SCallbackInfo& info, std::any param) { onMouseDown(info, std::any_cast(param)); }); + PHANDLE, "mouseButton", [&](void* self, SCallbackInfo& info, std::any param) { onMouseDown(info, std::any_cast(param)); }); m_pMouseMoveCallback = HyprlandAPI::registerCallbackDynamic(PHANDLE, "mouseMove", [&](void* self, SCallbackInfo& info, std::any param) { onMouseMove(std::any_cast(param)); }); @@ -50,7 +50,7 @@ std::string CHyprBar::getDisplayName() { return "Hyprbar"; } -void CHyprBar::onMouseDown(SCallbackInfo& info, wlr_pointer_button_event* e) { +void CHyprBar::onMouseDown(SCallbackInfo& info, IPointer::SButtonEvent e) { if (m_pWindow.lock() != g_pCompositor->m_pLastWindow.lock()) return; @@ -77,7 +77,7 @@ void CHyprBar::onMouseDown(SCallbackInfo& info, wlr_pointer_button_event* e) { return; } - if (e->state != WLR_BUTTON_PRESSED) { + if (e.state != WLR_BUTTON_PRESSED) { if (m_bCancelledDown) info.cancelled = true; diff --git a/hyprbars/barDeco.hpp b/hyprbars/barDeco.hpp index 7cc7287..2a8f7c1 100644 --- a/hyprbars/barDeco.hpp +++ b/hyprbars/barDeco.hpp @@ -4,6 +4,7 @@ #include #include +#include #include "globals.hpp" class CHyprBar : public IHyprWindowDecoration { @@ -54,7 +55,7 @@ class CHyprBar : public IHyprWindowDecoration { 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 renderBarButtonsText(CBox* barBox, const float scale, const float a); - void onMouseDown(SCallbackInfo& info, wlr_pointer_button_event* e); + void onMouseDown(SCallbackInfo& info, IPointer::SButtonEvent e); void onMouseMove(Vector2D coords); CBox assignedBoxGlobal();