From 102360f96ad4c079bfbdae81065b262b631fff0f Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Wed, 21 Jun 2023 21:18:44 -0700 Subject: [PATCH] Make shifting a node in a single node group always break that group The shifted node will also inherit the size of the group --- src/Hy3Layout.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp index 4490844..7874994 100644 --- a/src/Hy3Layout.cpp +++ b/src/Hy3Layout.cpp @@ -1415,7 +1415,14 @@ void Hy3Layout::shiftWindow(int workspace, ShiftDirection direction, bool once) Debug::log(LOG, "ShiftWindow %p %d", node, direction); if (node == nullptr) return; - this->shiftOrGetFocus(*node, direction, true, once, false); + if (once && node->parent != nullptr && node->parent->data.as_group.children.size() == 1) { + auto* node2 = node->parent; + Hy3Node::swapData(*node, *node2); + node2->layout->nodes.remove(*node); + node2->recalcSizePosRecursive(); + } else { + this->shiftOrGetFocus(*node, direction, true, once, false); + } } bool shiftIsForward(ShiftDirection direction) {