Skip to content

Commit

Permalink
fix: allfloat = false, adding new windows to a floating group
Browse files Browse the repository at this point in the history
  • Loading branch information
Aqa-Ib committed Sep 24, 2024
1 parent 7d616f1 commit d7649da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 5 additions & 3 deletions src/layout/DwindleLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Hyprlang::INT>("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();
Expand Down
9 changes: 5 additions & 4 deletions src/layout/MasterLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Hyprlang::INT>("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();
Expand Down

0 comments on commit d7649da

Please sign in to comment.