From e4d6695375ee8bc4250543ec8e2f372d6b52f2a9 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 18 Sep 2023 11:33:19 +0100 Subject: [PATCH] keybinds: focus last window on workspace change to another mon --- src/managers/KeybindManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 698758f3..9c9ae1da 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -859,8 +859,11 @@ void CKeybindManager::changeworkspace(std::string args) { PMONITORWORKSPACEOWNER->changeWorkspace(pWorkspaceToChangeTo, false, true); - if (PMONITOR != PMONITORWORKSPACEOWNER) + if (PMONITOR != PMONITORWORKSPACEOWNER) { g_pCompositor->warpCursorTo(PMONITORWORKSPACEOWNER->middle()); + if (const auto PLAST = pWorkspaceToChangeTo->getLastFocusedWindow(); PLAST) + g_pCompositor->focusWindow(PLAST); + } if (BISWORKSPACECURRENT) { if (*PALLOWWORKSPACECYCLES)