Add IPC event when a window is selected
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
1
main.cpp
1
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;
|
||||
|
||||
Reference in New Issue
Block a user