diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-04-14 15:28:22 +0100 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-04-14 15:28:22 +0100 |
| commit | 727160f0a4ef08dbcd543f1ffca64c6de30c9c44 (patch) | |
| tree | 95bc62cf0e658fded1603659b87499c6c038e0c9 /src/managers/KeybindManager.cpp | |
| parent | 3f2a18a4352bcf418d8a4645155f51904fdb4a47 (diff) | |
workspaces: fixup workspaces not activating on workspace switch
Diffstat (limited to 'src/managers/KeybindManager.cpp')
| -rw-r--r-- | src/managers/KeybindManager.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 9c3a5bec..df48fefe 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -777,6 +777,8 @@ void CKeybindManager::changeworkspace(std::string args) { if (!PMONITORWORKSPACEOWNER) return; + g_pCompositor->setActiveMonitor(PMONITORWORKSPACEOWNER); + const auto PREVWSDATA = pWorkspaceToChangeTo->m_sPrevWorkspace; PMONITORWORKSPACEOWNER->changeWorkspace(pWorkspaceToChangeTo); @@ -810,11 +812,12 @@ void CKeybindManager::changeworkspace(std::string args) { const auto PMONITORWORKSPACEOWNER = PMONITOR->ID == pWorkspaceToChangeTo->m_iMonitorID ? PMONITOR : g_pCompositor->getMonitorFromID(pWorkspaceToChangeTo->m_iMonitorID); + g_pCompositor->setActiveMonitor(PMONITORWORKSPACEOWNER); + PMONITORWORKSPACEOWNER->changeWorkspace(pWorkspaceToChangeTo); g_pCompositor->warpCursorTo(PMONITORWORKSPACEOWNER->vecPosition + PMONITORWORKSPACEOWNER->vecSize / 2.f); if (PMONITOR != PMONITORWORKSPACEOWNER) { - g_pCompositor->setActiveMonitor(PMONITORWORKSPACEOWNER); if (const auto PLASTWINDOW = pWorkspaceToChangeTo->getLastFocusedWindow(); PLASTWINDOW) g_pCompositor->focusWindow(PLASTWINDOW); else @@ -869,6 +872,7 @@ void CKeybindManager::moveActiveToWorkspace(std::string args) { if (pWorkspace) { g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, pWorkspace); const auto PMONITOR = g_pCompositor->getMonitorFromID(pWorkspace->m_iMonitorID); + g_pCompositor->setActiveMonitor(PMONITOR); PMONITOR->changeWorkspace(pWorkspace); } else { const auto PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID); |
