mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-09-11 21:27:20 +03: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
@ -1977,15 +1977,19 @@ void CKeybindManager::moveWindowOutOfGroup(CWindow* pWindow, const std::string&
|
|||||||
default: direction = DIRECTION_DEFAULT;
|
default: direction = DIRECTION_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_pLayoutManager->getCurrentLayout()->onWindowRemoved(pWindow);
|
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;
|
const auto GROUPSLOCKEDPREV = g_pKeybindManager->m_bGroupsLocked;
|
||||||
|
g_pKeybindManager->m_bGroupsLocked = true;
|
||||||
|
|
||||||
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) {
|
if (*BFOCUSREMOVEDWINDOW) {
|
||||||
g_pCompositor->focusWindow(pWindow);
|
g_pCompositor->focusWindow(pWindow);
|
||||||
|
Loading…
Reference in New Issue
Block a user