diff options
| author | dranull <150595692+dranull@users.noreply.github.com> | 2024-01-02 13:50:30 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-02 14:50:30 +0100 |
| commit | 3c33d4b9dda3c418a6b842c71720040b092f8510 (patch) | |
| tree | 3eb37bb7112290a02bb787fbf7ad3672d3a9fd14 /src/managers/KeybindManager.cpp | |
| parent | bd3ea8dcb5f7803b0cc05e25f84200102c0fad21 (diff) | |
keybinds: Refocus only if the silently moved window had the focus (#4328)
Diffstat (limited to 'src/managers/KeybindManager.cpp')
| -rw-r--r-- | src/managers/KeybindManager.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index d379a408..21cc1f74 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -1062,10 +1062,12 @@ void CKeybindManager::moveActiveToWorkspaceSilent(std::string args) { g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, pWorkspace); } - if (const auto PATCOORDS = g_pCompositor->vectorToWindowIdeal(OLDMIDDLE); PATCOORDS && PATCOORDS != PWINDOW) - g_pCompositor->focusWindow(PATCOORDS); - else - g_pInputManager->refocus(); + if (PWINDOW == g_pCompositor->m_pLastWindow) { + if (const auto PATCOORDS = g_pCompositor->vectorToWindowIdeal(OLDMIDDLE, PWINDOW); PATCOORDS) + g_pCompositor->focusWindow(PATCOORDS); + else + g_pInputManager->refocus(); + } } void CKeybindManager::moveFocusTo(std::string args) { |
