Fix focus not changing on (empty) workspace change (#1243)

This commit is contained in:
Julian Schuler 2022-12-17 18:28:43 +01:00 committed by GitHub
parent 11ba6afdd3
commit a3b37b0191
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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));