diff --git a/easymotionDeco.cpp b/easymotionDeco.cpp index 33f0a2d..b938d39 100644 --- a/easymotionDeco.cpp +++ b/easymotionDeco.cpp @@ -8,12 +8,12 @@ #include "globals.hpp" -CHyprEasyLabel::CHyprEasyLabel(CWindow* pWindow, SMotionActionDesc *actionDesc) : IHyprWindowDecoration(pWindow) { +CHyprEasyLabel::CHyprEasyLabel(PHLWINDOW pWindow, SMotionActionDesc *actionDesc) : IHyprWindowDecoration(pWindow) { m_pWindow = pWindow; const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID); PMONITOR->scheduledRecalc = true; - std::string windowAddr = std::format("0x{:x}", (uintptr_t)pWindow); + std::string windowAddr = std::format("0x{:x}", (uintptr_t)pWindow.get()); m_szActionCmd = std::vformat(actionDesc->commandString, std::make_format_args(windowAddr)); m_iTextSize = actionDesc->textSize; m_cTextColor = actionDesc->textColor; @@ -108,7 +108,7 @@ void CHyprEasyLabel::renderMotionString(Vector2D& bufferSize, const float scale) void CHyprEasyLabel::draw(CMonitor* pMonitor, float a) { - if (!g_pCompositor->windowValidMapped(m_pWindow)) + if (!validMapped(m_pWindow)) return; if (!m_pWindow->m_sSpecialRenderData.decorate) @@ -159,7 +159,7 @@ eDecorationType CHyprEasyLabel::getDecorationType() { return DECORATION_CUSTOM; } -void CHyprEasyLabel::updateWindow(CWindow* pWindow) { +void CHyprEasyLabel::updateWindow(PHLWINDOW pWindow) { damageEntire(); } @@ -192,6 +192,6 @@ CBox CHyprEasyLabel::assignedBoxGlobal() { return box.translate(WORKSPACEOFFSET); } -CWindow* CHyprEasyLabel::getOwner() { +PHLWINDOW CHyprEasyLabel::getOwner() { return m_pWindow; } diff --git a/easymotionDeco.hpp b/easymotionDeco.hpp index 6ea8487..f8fbdd4 100644 --- a/easymotionDeco.hpp +++ b/easymotionDeco.hpp @@ -9,7 +9,7 @@ class CHyprEasyLabel : public IHyprWindowDecoration { public: - CHyprEasyLabel(CWindow*, SMotionActionDesc *actionDesc); + CHyprEasyLabel(PHLWINDOW, SMotionActionDesc *actionDesc); virtual ~CHyprEasyLabel(); virtual SDecorationPositioningInfo getPositioningInfo(); @@ -20,7 +20,7 @@ class CHyprEasyLabel : public IHyprWindowDecoration { virtual eDecorationType getDecorationType(); - virtual void updateWindow(CWindow*); + virtual void updateWindow(PHLWINDOW); virtual void damageEntire(); @@ -32,7 +32,7 @@ class CHyprEasyLabel : public IHyprWindowDecoration { virtual std::string getDisplayName(); - CWindow* getOwner(); + PHLWINDOW getOwner(); std::string m_szLabel; std::string m_szActionCmd; @@ -58,7 +58,7 @@ class CHyprEasyLabel : public IHyprWindowDecoration { int layoutHeight; SWindowDecorationExtents m_seExtents; - CWindow* m_pWindow = nullptr; + PHLWINDOW m_pWindow; CTexture m_tTextTex; diff --git a/main.cpp b/main.cpp index 0deb0d4..4f66d8a 100644 --- a/main.cpp +++ b/main.cpp @@ -47,7 +47,7 @@ void addEasyMotionKeybinds() } -void addLabelToWindow(CWindow *window, SMotionActionDesc *actionDesc, std::string &label) +void addLabelToWindow(PHLWINDOW window, SMotionActionDesc *actionDesc, std::string &label) { std::unique_ptr motionlabel = std::make_unique(window, actionDesc); motionlabel.get()->m_szLabel = label; @@ -171,7 +171,7 @@ void easymotionDispatch(std::string args) if (w->isHidden() || !w->m_bIsMapped || w->m_bFadingOut) continue; std::string lstr = actionDesc.motionKeys.substr(key_idx++, 1); - addLabelToWindow(w.get(), &actionDesc, lstr); + addLabelToWindow(w, &actionDesc, lstr); } } }