mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-09 16:05:58 +01:00
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.
This commit is contained in:
parent
41e5f401c5
commit
4f88897fc0
1 changed files with 10 additions and 6 deletions
|
@ -1977,15 +1977,19 @@ void CKeybindManager::moveWindowOutOfGroup(CWindow* pWindow, const std::string&
|
|||
default: direction = DIRECTION_DEFAULT;
|
||||
}
|
||||
|
||||
if (pWindow->m_sGroupData.pNextWindow == pWindow) {
|
||||
pWindow->m_sGroupData.pNextWindow = nullptr;
|
||||
pWindow->updateWindowDecos();
|
||||
} else {
|
||||
g_pLayoutManager->getCurrentLayout()->onWindowRemoved(pWindow);
|
||||
|
||||
const auto GROUPSLOCKEDPREV = g_pKeybindManager->m_bGroupsLocked;
|
||||
|
||||
g_pKeybindManager->m_bGroupsLocked = true;
|
||||
|
||||
g_pLayoutManager->getCurrentLayout()->onWindowCreated(pWindow, direction);
|
||||
|
||||
g_pKeybindManager->m_bGroupsLocked = GROUPSLOCKEDPREV;
|
||||
}
|
||||
|
||||
if (*BFOCUSREMOVEDWINDOW) {
|
||||
g_pCompositor->focusWindow(pWindow);
|
||||
|
|
Loading…
Reference in a new issue