From d7649da7bdbb44c9d302da96da61aedde1cd3148 Mon Sep 17 00:00:00 2001 From: Aqa-Ib Date: Tue, 24 Sep 2024 15:09:55 +0200 Subject: [PATCH] fix: allfloat = false, adding new windows to a floating group --- src/layout/DwindleLayout.cpp | 8 +++++--- src/layout/MasterLayout.cpp | 9 +++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index 1cc17ca117b..64b0aba4026 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -361,14 +361,16 @@ void CHyprDwindleLayout::onWindowCreatedTiling(PHLWINDOW pWindow, eDirection dir return; } - + // auto group the new window if the focused window is a floating group const auto PLASTWINDOW = g_pCompositor->m_pLastWindow; if (*AUTOGROUP && PLASTWINDOW && PLASTWINDOW->m_bIsFloating && PLASTWINDOW->m_sGroupData.pNextWindow // target is the focused floating group && pWindow->canBeGroupedInto(PLASTWINDOW.lock())) { - static auto USECURRPOS = CConfigValue("group:insert_after_current"); - (*USECURRPOS ? PLASTWINDOW : PLASTWINDOW->getGroupTail())->insertWindowToGroup(pWindow); + // make the new window floating before merging into the focused floating group + pWindow->m_bIsFloating = true; + m_lDwindleNodesData.remove(*PNODE); + g_pLayoutManager->getCurrentLayout()->onWindowCreatedFloating(pWindow); PLASTWINDOW->setGroupCurrent(pWindow); pWindow->applyGroupRules(); diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index edc6dbe19e2..fb10e7dc962 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -138,15 +138,16 @@ void CHyprMasterLayout::onWindowCreatedTiling(PHLWINDOW pWindow, eDirection dire return; } - + // auto group the new window if the focused window is a floating group const auto PLASTWINDOW = g_pCompositor->m_pLastWindow; if (*AUTOGROUP && PLASTWINDOW && PLASTWINDOW->m_bIsFloating && PLASTWINDOW->m_sGroupData.pNextWindow // target is the focused floating group && pWindow->canBeGroupedInto(PLASTWINDOW.lock())) { - m_lMasterNodesData.remove(*PNODE); - static auto USECURRPOS = CConfigValue("group:insert_after_current"); - (*USECURRPOS ? PLASTWINDOW : PLASTWINDOW->getGroupTail())->insertWindowToGroup(pWindow); + // make the new window floating before merging into the focused floating group + pWindow->m_bIsFloating = true; + m_lMasterNodesData.remove(*PNODE); + g_pLayoutManager->getCurrentLayout()->onWindowCreatedFloating(pWindow); PLASTWINDOW->setGroupCurrent(pWindow); pWindow->applyGroupRules();