Dwindle window group fixes

fixed a crash and animations in the bg
This commit is contained in:
vaxerski 2022-04-12 19:18:26 +02:00
parent b6a93b2f03
commit 4bd23604f8
2 changed files with 13 additions and 13 deletions

View file

@ -283,20 +283,9 @@ void CHyprDwindleLayout::onWindowRemoved(CWindow* pWindow) {
} }
} }
if (PSIBLING->pParent)
PSIBLING->pParent->recalcSizePosRecursive();
else
PSIBLING->recalcSizePosRecursive();
// check if it was grouped // check if it was grouped
if (PNODE->pGroupParent) { if (PNODE->pGroupParent) {
const auto MEMBERSCOPY = PNODE->pGroupParent->groupMembers; PNODE->pGroupParent->groupMembers.erase(PNODE->pGroupParent->groupMembers.begin() + PNODE->pGroupParent->groupMemberActive);
PNODE->pGroupParent->groupMembers.clear();
for (auto& c : MEMBERSCOPY) {
if (c != PNODE) {
PNODE->pGroupParent->groupMembers.push_back(c);
}
}
if ((long unsigned int)PNODE->pGroupParent->groupMemberActive >= PNODE->pGroupParent->groupMembers.size()) if ((long unsigned int)PNODE->pGroupParent->groupMemberActive >= PNODE->pGroupParent->groupMembers.size())
PNODE->pGroupParent->groupMemberActive = 0; PNODE->pGroupParent->groupMemberActive = 0;
@ -310,7 +299,17 @@ void CHyprDwindleLayout::onWindowRemoved(CWindow* pWindow) {
} else { } else {
PNODE->pGroupParent->recalcSizePosRecursive(); 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(*PPARENT);
m_lDwindleNodesData.remove(*PNODE); m_lDwindleNodesData.remove(*PNODE);

View file

@ -48,7 +48,8 @@ void CAnimationManager::tick() {
} }
// process fadein/out for unmapped windows, but nothing else. // 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; continue;
// process the borders // process the borders