diff --git a/easymotionDeco.cpp b/easymotionDeco.cpp index 7537fe8..4ab6cbc 100644 --- a/easymotionDeco.cpp +++ b/easymotionDeco.cpp @@ -13,8 +13,8 @@ CHyprEasyLabel::CHyprEasyLabel(PHLWINDOW pWindow, SMotionActionDesc *actionDesc) const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID); PMONITOR->scheduledRecalc = true; - std::string windowAddr = std::format("0x{:x}", (uintptr_t)pWindow.get()); - m_szActionCmd = std::vformat(actionDesc->commandString, std::make_format_args(windowAddr)); + m_szWindowAddress = std::format("0x{:x}", (uintptr_t)pWindow.get()); + m_szActionCmd = std::vformat(actionDesc->commandString, std::make_format_args(m_szWindowAddress)); m_iTextSize = actionDesc->textSize; m_cTextColor = actionDesc->textColor; m_cBackgroundColor = actionDesc->backgroundColor; diff --git a/easymotionDeco.hpp b/easymotionDeco.hpp index 5250bc7..6c8555c 100644 --- a/easymotionDeco.hpp +++ b/easymotionDeco.hpp @@ -38,6 +38,7 @@ class CHyprEasyLabel : public IHyprWindowDecoration { std::string m_szLabel; std::string m_szActionCmd; std::string m_szTextFont; + std::string m_szWindowAddress; int m_iTextSize; int m_iPaddingTop; int m_iPaddingBottom; diff --git a/main.cpp b/main.cpp index bcb194c..408f0db 100644 --- a/main.cpp +++ b/main.cpp @@ -29,6 +29,7 @@ void easymotionActionDispatch(std::string args) { for (auto &ml : g_pGlobalState->motionLabels) { if (ml->m_szLabel == args) { + g_pEventManager->postEvent(SHyprIPCEvent{"easymotionselect", std::format("{},{}", ml->m_szWindowAddress, ml->m_szLabel)}); g_pKeybindManager->m_mDispatchers["exec"](ml->m_szActionCmd); easymotionExitDispatch(""); break;