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); diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp index 48d56148..8c1f6e38 100644 --- a/src/managers/AnimationManager.cpp +++ b/src/managers/AnimationManager.cpp @@ -48,7 +48,8 @@ void CAnimationManager::tick() { } // process fadein/out for unmapped windows, but nothing else. - if (!g_pCompositor->windowValidMapped(&w)) + // we can't use windowValidMapped because we want to animate hidden windows too. + if (!g_pCompositor->windowExists(&w) || !w.m_bIsMapped || !g_pXWaylandManager->getWindowSurface(&w)) continue; // process the borders