summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
authorJulian Schuler <31921487+julianschuler@users.noreply.github.com>2022-12-17 18:28:43 +0100
committerGitHub <noreply@github.com>2022-12-17 17:28:43 +0000
commita3b37b0191ff5bbf5ccba44944966fff8e8ecd57 (patch)
tree41c78f8af134c63c3a3dd4b77b41f21d000a8d83 /src/managers/KeybindManager.cpp
parent11ba6afdd38453cca1d32530d19f5717c8b6e6fb (diff)
Fix focus not changing on (empty) workspace change (#1243)
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index f41f47bf..77db9eca 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -781,6 +781,10 @@ void CKeybindManager::changeworkspace(std::string args) {
g_pInputManager->refocus();
} else if (g_pCompositor->getWindowsOnWorkspace(PWORKSPACETOCHANGETO->m_iID) > 0)
g_pInputManager->refocus();
+ else {
+ // if there are no windows on the workspace, just unfocus the window on the previous workspace
+ g_pCompositor->focusWindow(nullptr);
+ }
// set the new monitor as the last (no warps would bug otherwise)
g_pCompositor->setActiveMonitor(g_pCompositor->getMonitorFromID(PWORKSPACETOCHANGETO->m_iMonitorID));