diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2018-05-31 11:51:00 -0400 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2018-05-31 11:51:00 -0400 |
commit | 633bee9019462ab7225e027c9ff84e6c06923a9d (patch) | |
tree | fc3a10bfab367a202318b95730bdfb55a3aad8ee | |
parent | Merge pull request #2065 from RedSoxFan/fix-2018 (diff) | |
download | sway-633bee9019462ab7225e027c9ff84e6c06923a9d.tar.gz sway-633bee9019462ab7225e027c9ff84e6c06923a9d.tar.zst sway-633bee9019462ab7225e027c9ff84e6c06923a9d.zip |
Fix moving out of tab/stack when only child
-rw-r--r-- | sway/tree/layout.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 9594b75a..6ee8b33b 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -312,6 +312,19 @@ static void workspace_rejigger(struct sway_container *ws, | |||
312 | static void move_out_of_tabs_stacks(struct sway_container *container, | 312 | static void move_out_of_tabs_stacks(struct sway_container *container, |
313 | struct sway_container *current, enum movement_direction move_dir, | 313 | struct sway_container *current, enum movement_direction move_dir, |
314 | int offs) { | 314 | int offs) { |
315 | if (container->parent == current->parent | ||
316 | && current->parent->children->length == 1) { | ||
317 | wlr_log(L_DEBUG, "Changing layout of %zd", current->parent->id); | ||
318 | current->parent->layout = move_dir = | ||
319 | MOVE_LEFT || move_dir == MOVE_RIGHT ? L_HORIZ : L_VERT; | ||
320 | if (current->parent->type == C_WORKSPACE) { | ||
321 | arrange_workspace(current->parent); | ||
322 | } else { | ||
323 | arrange_children_of(current->parent); | ||
324 | } | ||
325 | return; | ||
326 | } | ||
327 | |||
315 | wlr_log(L_DEBUG, "Moving out of tab/stack into a split"); | 328 | wlr_log(L_DEBUG, "Moving out of tab/stack into a split"); |
316 | bool is_workspace = current->parent->type == C_WORKSPACE; | 329 | bool is_workspace = current->parent->type == C_WORKSPACE; |
317 | struct sway_container *old_parent = current->parent->parent; | 330 | struct sway_container *old_parent = current->parent->parent; |