keybinds: Refocus only if the silently moved window had the focus (#4328)

This commit is contained in:
dranull 2024-01-02 13:50:30 +00:00 committed by GitHub
parent bd3ea8dcb5
commit 3c33d4b9dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1062,11 +1062,13 @@ void CKeybindManager::moveActiveToWorkspaceSilent(std::string args) {
g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, pWorkspace); g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, pWorkspace);
} }
if (const auto PATCOORDS = g_pCompositor->vectorToWindowIdeal(OLDMIDDLE); PATCOORDS && PATCOORDS != PWINDOW) if (PWINDOW == g_pCompositor->m_pLastWindow) {
if (const auto PATCOORDS = g_pCompositor->vectorToWindowIdeal(OLDMIDDLE, PWINDOW); PATCOORDS)
g_pCompositor->focusWindow(PATCOORDS); g_pCompositor->focusWindow(PATCOORDS);
else else
g_pInputManager->refocus(); g_pInputManager->refocus();
} }
}
void CKeybindManager::moveFocusTo(std::string args) { void CKeybindManager::moveFocusTo(std::string args) {
static auto* const PFULLCYCLE = &g_pConfigManager->getConfigValuePtr("binds:movefocus_cycles_fullscreen")->intValue; static auto* const PFULLCYCLE = &g_pConfigManager->getConfigValuePtr("binds:movefocus_cycles_fullscreen")->intValue;