Don't enter submap if no decos were created. Don't create motions for hidden unampped or fading windows
This commit is contained in:
7
main.cpp
7
main.cpp
@@ -168,12 +168,15 @@ void easymotionDispatch(std::string args)
|
||||
for (auto &w : g_pCompositor->m_vWindows) {
|
||||
for (auto &m : g_pCompositor->m_vMonitors) {
|
||||
if (w->m_pWorkspace == m->activeWorkspace) {
|
||||
if (w->isHidden() || !w->m_bIsMapped || w->m_bFadingOut)
|
||||
continue;
|
||||
std::string lstr = actionDesc.motionKeys.substr(key_idx++, 1);
|
||||
addLabelToWindow(w.get(), &actionDesc, lstr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!g_pGlobalState->motionLabels.empty())
|
||||
HyprlandAPI::invokeHyprctlCommand("dispatch", "submap __easymotionsubmap__");
|
||||
}
|
||||
|
||||
@@ -225,10 +228,10 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
|
||||
HyprlandAPI::addDispatcher(PHANDLE, "easymotion", easymotionDispatch);
|
||||
HyprlandAPI::addDispatcher(PHANDLE, "easymotionaction", easymotionActionDispatch);
|
||||
HyprlandAPI::addDispatcher(PHANDLE, "easymotionexit", easymotionExitDispatch);
|
||||
HyprlandAPI::registerCallbackDynamic(PHANDLE, "keyPress", [&](void *self, SCallbackInfo &info, std::any data) {
|
||||
static auto KPHOOK = HyprlandAPI::registerCallbackDynamic(PHANDLE, "keyPress", [&](void *self, SCallbackInfo &info, std::any data) {
|
||||
info.cancelled = oneasymotionKeypress(self, data);
|
||||
});
|
||||
HyprlandAPI::registerCallbackDynamic(PHANDLE, "configReloaded", [&](void *self, SCallbackInfo&, std::any data) {addEasyMotionKeybinds();});
|
||||
static auto CRHOOK = HyprlandAPI::registerCallbackDynamic(PHANDLE, "configReloaded", [&](void *self, SCallbackInfo&, std::any data) {addEasyMotionKeybinds();});
|
||||
HyprlandAPI::reloadConfig();
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user