From a9785649c59e458a850a6382373a9c84bdfa241b 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 | 6 ++++-- src/layout/MasterLayout.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index ed9dad83379..f63fabe25ea 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -367,8 +367,10 @@ void CHyprDwindleLayout::onWindowCreatedTiling(PHLWINDOW pWindow, eDirection dir 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 bf12c97129b..5ee8d08ad48 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -143,10 +143,11 @@ void CHyprMasterLayout::onWindowCreatedTiling(PHLWINDOW pWindow, eDirection dire 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();