summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-04-14 17:03:12 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-04-14 17:03:12 +0100
commit7ec23254fd19fe2bf5b35b2bb07623ce87a23c41 (patch)
tree4f7e30f768878a8a1658115946c05a8933ee7f81 /src/managers/KeybindManager.cpp
parentc2b5dd1be6e108614c8a30aec817925540815a87 (diff)
workspace: don't lose monitor with refocus on no warps
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index fb902e74..06ff8d39 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -788,8 +788,10 @@ void CKeybindManager::changeworkspace(std::string args) {
g_pCompositor->setActiveMonitor(PMONITORWORKSPACEOWNER);
if (const auto PLASTWINDOW = pWorkspaceToChangeTo->getLastFocusedWindow(); PLASTWINDOW)
g_pCompositor->focusWindow(PLASTWINDOW);
+ else if (const auto PFIRSTWINDOW = g_pCompositor->getFirstWindowOnWorkspace(pWorkspaceToChangeTo->m_iID); PFIRSTWINDOW)
+ g_pCompositor->focusWindow(PFIRSTWINDOW);
else
- g_pInputManager->refocus();
+ g_pCompositor->focusWindow(nullptr);
}
if (*PALLOWWORKSPACECYCLES)
@@ -822,8 +824,10 @@ void CKeybindManager::changeworkspace(std::string args) {
if (const auto PLASTWINDOW = pWorkspaceToChangeTo->getLastFocusedWindow(); PLASTWINDOW)
g_pCompositor->focusWindow(PLASTWINDOW);
+ else if (const auto PFIRSTWINDOW = g_pCompositor->getFirstWindowOnWorkspace(pWorkspaceToChangeTo->m_iID); PFIRSTWINDOW)
+ g_pCompositor->focusWindow(PFIRSTWINDOW);
else
- g_pInputManager->refocus();
+ g_pCompositor->focusWindow(nullptr);
}
pWorkspaceToChangeTo->m_sPrevWorkspace = {PCURRENTWORKSPACE->m_iID, PCURRENTWORKSPACE->m_szName};