mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-03 21:51:55 -07: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:
@@ -1977,15 +1977,19 @@ void CKeybindManager::moveWindowOutOfGroup(CWindow* pWindow, const std::string&
|
|||||||
default: direction = DIRECTION_DEFAULT;
|
default: direction = DIRECTION_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pWindow->m_sGroupData.pNextWindow == pWindow) {
|
||||||
|
pWindow->m_sGroupData.pNextWindow = nullptr;
|
||||||
|
pWindow->updateWindowDecos();
|
||||||
|
} else {
|
||||||
g_pLayoutManager->getCurrentLayout()->onWindowRemoved(pWindow);
|
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);
|
||||||
|
Reference in New Issue
Block a user