diff options
-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..b175f567 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; |