diff options
author | Aqa-Ib <[email protected]> | 2024-10-13 23:25:19 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-10-14 00:25:19 +0100 |
commit | e7fd0f5aec85c11a8eaf5e1abf8504f0a6d0710e (patch) | |
tree | 6d15dd0f0805320e6cc8c05b081ebadc1fe54972 | |
parent | abfd550ee228ea23058039790e792b45d2467c8d (diff) | |
download | Hyprland-e7fd0f5aec85c11a8eaf5e1abf8504f0a6d0710e.tar.gz Hyprland-e7fd0f5aec85c11a8eaf5e1abf8504f0a6d0710e.zip |
layout: deny auto-grouping a new floating window into a tiled group (#8108)
-rw-r--r-- | src/layout/IHyprLayout.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index 24ee13f4..80c9abff 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -186,12 +186,17 @@ bool IHyprLayout::onWindowCreatedAutoGroup(PHLWINDOW pWindow) { g_pCompositor->m_pLastWindow.lock() : g_pCompositor->getFirstWindowOnWorkspace(pWindow->workspaceID()); - if (*PAUTOGROUP // check if auto_group is enabled. - && OPENINGON // check if OPENINGON exists. - && OPENINGON != pWindow // fixes a freeze when activating togglefloat to transform a floating group into a tiled group. - && OPENINGON->m_sGroupData.pNextWindow.lock() // check if OPENINGON is a group - && pWindow->canBeGroupedInto(OPENINGON) // check if the new window can be grouped into OPENINGON - && !g_pXWaylandManager->shouldBeFloated(pWindow)) { // don't group XWayland windows that should be floated. + bool denied = false; + if (pWindow->m_bIsFloating && !OPENINGON->m_bIsFloating) + denied = true; + + if (*PAUTOGROUP // check if auto_group is enabled. + && OPENINGON // check if OPENINGON exists. + && OPENINGON != pWindow // fixes a freeze when activating togglefloat to transform a floating group into a tiled group. + && OPENINGON->m_sGroupData.pNextWindow.lock() // check if OPENINGON is a group. + && pWindow->canBeGroupedInto(OPENINGON) // check if the new window can be grouped into OPENINGON. + && !g_pXWaylandManager->shouldBeFloated(pWindow) // don't group a new window that should be floated. + && !denied) { // don't group a new floated window into a tiled group. pWindow->m_bIsFloating = OPENINGON->m_bIsFloating; // match the floating state |