diff options
author | memchr <[email protected]> | 2023-09-13 10:44:02 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2023-09-13 11:44:02 +0100 |
commit | 4f88897fc0eaa176032c5163eb19043133b36863 (patch) | |
tree | 6a66bf4e2faac4a1a504f5c757437a7439d4e4e9 | |
parent | 41e5f401c570eccc0546dcff8bfbe09af16e3ff4 (diff) | |
download | Hyprland-4f88897fc0eaa176032c5163eb19043133b36863.tar.gz Hyprland-4f88897fc0eaa176032c5163eb19043133b36863.zip |
keybinds: avoid onWindowRemoved & onWindowCreated when group has one member (#3286)
Make moveWindowOutOfGroup behave like toggleGroup on a group with single
member, this prevents the window from moving around rabidly.
-rw-r--r-- | src/managers/KeybindManager.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index e8c7a069..7e2f2f3f 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -1977,15 +1977,19 @@ void CKeybindManager::moveWindowOutOfGroup(CWindow* pWindow, const std::string& default: direction = DIRECTION_DEFAULT; } - g_pLayoutManager->getCurrentLayout()->onWindowRemoved(pWindow); - - const auto GROUPSLOCKEDPREV = g_pKeybindManager->m_bGroupsLocked; + if (pWindow->m_sGroupData.pNextWindow == pWindow) { + pWindow->m_sGroupData.pNextWindow = nullptr; + pWindow->updateWindowDecos(); + } else { + g_pLayoutManager->getCurrentLayout()->onWindowRemoved(pWindow); - g_pKeybindManager->m_bGroupsLocked = true; + const auto GROUPSLOCKEDPREV = g_pKeybindManager->m_bGroupsLocked; + g_pKeybindManager->m_bGroupsLocked = true; - g_pLayoutManager->getCurrentLayout()->onWindowCreated(pWindow, direction); + g_pLayoutManager->getCurrentLayout()->onWindowCreated(pWindow, direction); - g_pKeybindManager->m_bGroupsLocked = GROUPSLOCKEDPREV; + g_pKeybindManager->m_bGroupsLocked = GROUPSLOCKEDPREV; + } if (*BFOCUSREMOVEDWINDOW) { g_pCompositor->focusWindow(pWindow); |