summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
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));