Skip to content

Commit

Permalink
commentary
Browse files Browse the repository at this point in the history
  • Loading branch information
Aqa-Ib committed Sep 24, 2024
1 parent 6aba6e8 commit 2c620e9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
9 changes: 6 additions & 3 deletions src/layout/DwindleLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,10 @@ void CHyprDwindleLayout::onWindowCreatedTiling(PHLWINDOW pWindow, eDirection dir
return;
}

// If the active window is a group and auto_group = true:
static auto AUTOGROUP = CConfigValue<Hyprlang::INT>("group:auto_group");
// auto group the window if OPENINGON is a tiled group

// auto group the new tiling window if OPENINGON is a tiled group
if (*AUTOGROUP && OPENINGON->pWindow->m_sGroupData.pNextWindow.lock() // target is a tiled group
&& pWindow->canBeGroupedInto(OPENINGON->pWindow.lock()) && !m_vOverrideFocalPoint) { // we are not moving window
m_lDwindleNodesData.remove(*PNODE);
Expand All @@ -359,9 +361,10 @@ void CHyprDwindleLayout::onWindowCreatedTiling(PHLWINDOW pWindow, eDirection dir

return;
}
// auto group the window if the last window is a floating group

// auto group the new tiling 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 a floating group
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");
Expand Down
8 changes: 4 additions & 4 deletions src/layout/IHyprLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ void IHyprLayout::onWindowRemovedFloating(PHLWINDOW pWindow) {

void IHyprLayout::onWindowCreatedFloating(PHLWINDOW pWindow) {

// auto group the window if the last window is a floating group
static auto AUTOGROUP = CConfigValue<Hyprlang::INT>("group:auto_group");
const auto PLASTWINDOW = g_pCompositor->m_pLastWindow;
if (*AUTOGROUP && PLASTWINDOW && PLASTWINDOW->m_bIsFloating && PLASTWINDOW->m_sGroupData.pNextWindow // target is a floating group
// auto group the new floating window if the focused window is a floating group
static auto AUTOGROUP = CConfigValue<Hyprlang::INT>("group:auto_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");
Expand Down
9 changes: 6 additions & 3 deletions src/layout/MasterLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ void CHyprMasterLayout::onWindowCreatedTiling(PHLWINDOW pWindow, eDirection dire
return;
}

// If the active window is a group and auto_group = true:
static auto AUTOGROUP = CConfigValue<Hyprlang::INT>("group:auto_group");
// auto group the window if OPENINGON is a tiled group

// auto group the new tiling window if OPENINGON is a tiled group
if (*AUTOGROUP && OPENINGON && OPENINGON != PNODE && OPENINGON->pWindow->m_sGroupData.pNextWindow.lock() // target is a tiled group
&& pWindow->canBeGroupedInto(OPENINGON->pWindow.lock())) {

Expand All @@ -136,9 +138,10 @@ void CHyprMasterLayout::onWindowCreatedTiling(PHLWINDOW pWindow, eDirection dire

return;
}
// auto group the window if the last window is a floating group

// auto group the new tiling 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 a floating group
if (*AUTOGROUP && PLASTWINDOW && PLASTWINDOW->m_bIsFloating && PLASTWINDOW->m_sGroupData.pNextWindow // target is the focused floating group
&& pWindow->canBeGroupedInto(PLASTWINDOW.lock())) {
m_lMasterNodesData.remove(*PNODE);

Expand Down

0 comments on commit 2c620e9

Please sign in to comment.