diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-06-21 22:17:30 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-06-21 22:17:30 +0200 |
| commit | 4a3f9ccba2cebaf62d6001c2b700367785a7179c (patch) | |
| tree | 13408a6441265f729938c62184318cf99564b037 /src/managers/KeybindManager.cpp | |
| parent | ff49f2244069124d366e2eba5e5474398a14281a (diff) | |
move ignore to eventmanager and fix double focus in changeworkspace
Diffstat (limited to 'src/managers/KeybindManager.cpp')
| -rw-r--r-- | src/managers/KeybindManager.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 123e560c..96d8ce60 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -280,9 +280,7 @@ void CKeybindManager::changeworkspace(std::string args) { // start anim on new workspace PWORKSPACETOCHANGETO->startAnim(true, ANIMTOLEFT); - // Event ONLY if workspace is actually "changed" and we arent just focusing - if (!m_bSuppressWorkspaceChangeEvents) - g_pEventManager->postEvent(SHyprIPCEvent("workspace", PWORKSPACETOCHANGETO->m_szName)); + g_pEventManager->postEvent(SHyprIPCEvent("workspace", PWORKSPACETOCHANGETO->m_szName)); } // If the monitor is not the one our cursor's at, warp to it. @@ -291,9 +289,6 @@ void CKeybindManager::changeworkspace(std::string args) { wlr_cursor_warp(g_pCompositor->m_sWLRCursor, nullptr, middle.x, middle.y); } - // focus the first window - g_pCompositor->focusWindow(g_pCompositor->getFirstWindowOnWorkspace(workspaceToChangeTo)); - // set active and deactivate all other in wlr g_pCompositor->deactivateAllWLRWorkspaces(PWORKSPACETOCHANGETO->m_pWlrHandle); PWORKSPACETOCHANGETO->setActive(true); @@ -360,8 +355,7 @@ void CKeybindManager::changeworkspace(std::string args) { g_pInputManager->refocus(); // Event - if (!m_bSuppressWorkspaceChangeEvents) - g_pEventManager->postEvent(SHyprIPCEvent("workspace", PWORKSPACE->m_szName)); + g_pEventManager->postEvent(SHyprIPCEvent("workspace", PWORKSPACE->m_szName)); Debug::log(LOG, "Changed to workspace %i", workspaceToChangeTo); } @@ -491,7 +485,7 @@ void CKeybindManager::moveActiveToWorkspaceSilent(std::string args) { const auto POLDWORKSPACEONMON = g_pCompositor->getWorkspaceByID(OLDWORKSPACEIDONMONITOR); const auto POLDWORKSPACEIDRETURN = g_pCompositor->getWorkspaceByID(OLDWORKSPACEIDRETURN); - m_bSuppressWorkspaceChangeEvents = true; + g_pEventManager->m_bIgnoreEvents = true; moveActiveToWorkspace(args); @@ -510,7 +504,7 @@ void CKeybindManager::moveActiveToWorkspaceSilent(std::string args) { POLDWORKSPACEONMON->m_vRenderOffset.setValueAndWarp(Vector2D(0, 0)); POLDWORKSPACEONMON->m_fAlpha.setValueAndWarp(255.f); - m_bSuppressWorkspaceChangeEvents = false; + g_pEventManager->m_bIgnoreEvents = false; g_pInputManager->refocus(); } |
