summaryrefslogtreecommitdiff
path: root/src/layout/DwindleLayout.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-12 19:18:26 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-12 19:18:26 +0200
commit4bd23604f88708718df0f5e5971b2d1169e13e9b (patch)
treed489d9a78004d44028babcbe26e4b71d6c31fbaa /src/layout/DwindleLayout.cpp
parentb6a93b2f0383fc8f084c7757f0f67b8c0ebeccc7 (diff)
Dwindle window group fixes
fixed a crash and animations in the bg
Diffstat (limited to 'src/layout/DwindleLayout.cpp')
-rw-r--r--src/layout/DwindleLayout.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp
index b007ae8e..6faf6538 100644
--- a/src/layout/DwindleLayout.cpp
+++ b/src/layout/DwindleLayout.cpp
@@ -283,20 +283,9 @@ void CHyprDwindleLayout::onWindowRemoved(CWindow* pWindow) {
}
}
- if (PSIBLING->pParent)
- PSIBLING->pParent->recalcSizePosRecursive();
- else
- PSIBLING->recalcSizePosRecursive();
-
// check if it was grouped
if (PNODE->pGroupParent) {
- const auto MEMBERSCOPY = PNODE->pGroupParent->groupMembers;
- PNODE->pGroupParent->groupMembers.clear();
- for (auto& c : MEMBERSCOPY) {
- if (c != PNODE) {
- PNODE->pGroupParent->groupMembers.push_back(c);
- }
- }
+ PNODE->pGroupParent->groupMembers.erase(PNODE->pGroupParent->groupMembers.begin() + PNODE->pGroupParent->groupMemberActive);
if ((long unsigned int)PNODE->pGroupParent->groupMemberActive >= PNODE->pGroupParent->groupMembers.size())
PNODE->pGroupParent->groupMemberActive = 0;
@@ -310,8 +299,18 @@ void CHyprDwindleLayout::onWindowRemoved(CWindow* pWindow) {
} else {
PNODE->pGroupParent->recalcSizePosRecursive();
}
+
+ // if the parent is to be removed, remove the group
+ if (PPARENT == PNODE->pGroupParent) {
+ toggleWindowGroup(PPARENT->groupMembers[PPARENT->groupMemberActive]->pWindow);
+ }
}
+ if (PSIBLING->pParent)
+ PSIBLING->pParent->recalcSizePosRecursive();
+ else
+ PSIBLING->recalcSizePosRecursive();
+
m_lDwindleNodesData.remove(*PPARENT);
m_lDwindleNodesData.remove(*PNODE);