From face71676cbe2bf70a40fb3d6bb7fe16d781202b Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Fri, 12 May 2023 01:07:27 -0700 Subject: [PATCH] Fix window shifting with `once` moving into oppositely tiled groups --- src/Hy3Layout.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp index 193cb34..ea8cae1 100644 --- a/src/Hy3Layout.cpp +++ b/src/Hy3Layout.cpp @@ -1187,10 +1187,10 @@ Hy3Node* Hy3Layout::shiftOrGetFocus(Hy3Node& node, ShiftDirection direction, boo if (!((!shiftIsForward(direction) && group.children.front() == break_origin) || (shiftIsForward(direction) && group.children.back() == break_origin))) break; + } else { + has_broken_once = true; } - has_broken_once = true; - if (break_parent->parent == nullptr) { if (!shift) return nullptr; @@ -1198,7 +1198,10 @@ Hy3Node* Hy3Layout::shiftOrGetFocus(Hy3Node& node, ShiftDirection direction, boo // there's no reason to wrap the root group. if (shiftMatchesLayout(group.layout, direction)) break; - if (group.layout != Hy3GroupLayout::Tabbed && group.children.size() == 2) { + if (group.layout != Hy3GroupLayout::Tabbed + && group.children.size() == 2 + && std::find(group.children.begin(), group.children.end(), &node) != group.children.end() + ) { group.layout = shiftIsVertical(direction) ? Hy3GroupLayout::SplitV : Hy3GroupLayout::SplitH; } else { // wrap the root group in another group