f58720ba832af0c3423a444f4f2eb6eae6b83f10

Author
Pete Appleton <pete+git@catcity.me.uk>
Committer
Pete Appleton <pete+git@catcity.me.uk>
Date

Message

Fix: Only constrain node resize if they are at the root of the layout

Diff

 1diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp
 2index 96b44593bcdf199967555148624b0cc05417679f..a9e00de126de4063ce15f2ab54497dce67599095 100644
 3--- a/src/Hy3Layout.cpp
 4+++ b/src/Hy3Layout.cpp
 5@@ -426,8 +426,13 @@ void Hy3Layout::resizeActiveWindow(const Vector2D& delta, eRectCorner corner, CW
 6 		);
 7 
 8 		Vector2D resize_delta = delta;
 9-		if (display_left && display_right) resize_delta.x = 0;
10-		if (display_top && display_bottom) resize_delta.y = 0;
11+		bool node_is_root = (node->data.type == Hy3NodeType::Group && node->parent == nullptr)
12+			|| (node->data.type == Hy3NodeType::Window && (node->parent == nullptr || node->parent->parent == nullptr));
13+
14+		if(node_is_root) {
15+			if (display_left && display_right) resize_delta.x = 0;
16+			if (display_top && display_bottom) resize_delta.y = 0;
17+		}
18 
19 		// Don't execute the logic unless there's something to do
20 		if(resize_delta.x != 0 || resize_delta.y != 0) {