Fix unintentional group swallowing when closing a window

This commit is contained in:
outfoxxed 2023-04-19 21:11:36 -07:00
parent d3014c9f92
commit bd3d973fbf
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E

View file

@ -526,15 +526,20 @@ void Hy3Layout::onWindowRemovedTiling(CWindow* window) {
if (parent != nullptr) {
parent->recalcSizePosRecursive();
if (parent->data.as_group.children.size() == 1
&& parent->data.as_group.children.front()->data.type == Hy3NodeData::Group)
{
auto* target_parent = parent;
while (target_parent != nullptr && swallowGroup(target_parent)) {
target_parent = target_parent->parent;
}
if (target_parent != parent && target_parent != nullptr)
target_parent->recalcSizePosRecursive();
}
}
auto* target_parent = parent;
while (target_parent != nullptr && swallowGroup(target_parent)) {
target_parent = target_parent->parent;
}
if (target_parent != parent && target_parent != nullptr)
target_parent->recalcSizePosRecursive();
}
CWindow* Hy3Layout::getNextWindowCandidate(CWindow* window) {