diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-04-13 22:20:31 +0100 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-04-13 22:20:31 +0100 |
| commit | 6131e0bef71b67b6ba5d1b395da2f3a4c2082551 (patch) | |
| tree | 2e5e4a011b63923f16cef39c10fbbc099e5a9790 /src/managers/KeybindManager.cpp | |
| parent | 41c7d896e38896916f0762acbc7f811a00240b4f (diff) | |
keybinds: refocus properly on silent move
Diffstat (limited to 'src/managers/KeybindManager.cpp')
| -rw-r--r-- | src/managers/KeybindManager.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index a039f43a..a04f67b9 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -1141,7 +1141,12 @@ void CKeybindManager::moveActiveToWorkspaceSilent(std::string args) { const auto PNEXTCANDIDATE = g_pLayoutManager->getCurrentLayout()->getNextWindowCandidate(PWINDOW); PWINDOW->m_iWorkspaceID = workspaceToMoveTo; - g_pCompositor->focusWindow(PNEXTCANDIDATE); + if (PNEXTCANDIDATE) + g_pCompositor->focusWindow(PNEXTCANDIDATE); + else if (const auto PFIRSTONWS = g_pCompositor->getFirstWindowOnWorkspace(OLDWORKSPACEIDRETURN); PFIRSTONWS) + g_pCompositor->focusWindow(PFIRSTONWS); + else + g_pInputManager->refocus(); } void CKeybindManager::moveFocusTo(std::string args) { |
