9082d9259f8e40133dfcb3742ee218aa75a3be51

Author
outfoxxed <outfoxxed@outfoxxed.me>
Committer
outfoxxed <outfoxxed@outfoxxed.me>
Date

Message

Fix single group nesting bug

Nested single child groups could be created by making a group with a
window and a single child group, then deleting the window.

Diff

 1diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp
 2index 756508441b06b1c3b1dcb601cc3a63720467c262..da403101898ca48ed780bc60a8271187ab7da57a 100644
 3--- a/src/Hy3Layout.cpp
 4+++ b/src/Hy3Layout.cpp
 5@@ -523,6 +523,14 @@ void Hy3Layout::onWindowRemovedTiling(CWindow* window) {
 6 	if (parent != nullptr) {
 7 		parent->recalcSizePosRecursive();
 8 	}
 9+
10+	auto* target_parent = parent;
11+	while (target_parent != nullptr && swallowGroup(target_parent)) {
12+		target_parent = target_parent->parent;
13+	}
14+
15+	if (target_parent != parent && target_parent != nullptr)
16+		target_parent->recalcSizePosRecursive();
17 }
18 
19 CWindow* Hy3Layout::getNextWindowCandidate(CWindow* window) {