1diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp
2index 1ee6be28d620d57091a44f7308509dda3fea2f53..7f1d918474debee82fb8659dac7f34907a51d339 100644
3--- a/src/Hy3Layout.cpp
4+++ b/src/Hy3Layout.cpp
5@@ -1177,18 +1177,19 @@ Hy3Node* Hy3Layout::shiftOrGetFocus(Hy3Node& node, ShiftDirection direction, boo
6 7 auto& group = break_parent->data.as_group; // must be a group in order to be a parent
8 9- if (once && shift && has_broken_once) break;
1011 if (shiftMatchesLayout(group.layout, direction)) {
12 // group has the correct orientation
1314+ if (once && shift && has_broken_once) break;
15+ if (break_origin != &node) has_broken_once = true;
16+
17 // if this movement would break out of the group, continue the break loop (do not enter this if)
18 // otherwise break.
19- if (!((!shiftIsForward(direction) && group.children.front() == break_origin)
20- || (shiftIsForward(direction) && group.children.back() == break_origin)))
21+ if ((has_broken_once && once && shift)
22+ || !((!shiftIsForward(direction) && group.children.front() == break_origin)
23+ || (shiftIsForward(direction) && group.children.back() == break_origin)))
24 break;
25- } else {
26- has_broken_once = true;
27 }
2829 if (break_parent->parent == nullptr) {