diff options
-rw-r--r-- | sway/tree/layout.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 77b2448a..78af8b8c 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -331,11 +331,17 @@ void container_move(struct sway_container *container, | |||
331 | } | 331 | } |
332 | case C_WORKSPACE: | 332 | case C_WORKSPACE: |
333 | if (!is_parallel(current->layout, move_dir)) { | 333 | if (!is_parallel(current->layout, move_dir)) { |
334 | if (current->children->length != 1) { | 334 | if (current->children->length > 2) { |
335 | // Special case | ||
336 | wlr_log(L_DEBUG, "Rejiggering the workspace (%d kiddos)", | 335 | wlr_log(L_DEBUG, "Rejiggering the workspace (%d kiddos)", |
337 | current->children->length); | 336 | current->children->length); |
338 | workspace_rejigger(current, container, move_dir); | 337 | workspace_rejigger(current, container, move_dir); |
338 | } else if (current->children->length == 2) { | ||
339 | wlr_log(L_DEBUG, "Changing workspace layout"); | ||
340 | container_set_layout(current, | ||
341 | move_dir == MOVE_LEFT || move_dir == MOVE_RIGHT ? | ||
342 | L_HORIZ : L_VERT); | ||
343 | container_insert_child(current, container, offs < 0 ? 0 : 1); | ||
344 | arrange_windows(current, -1, -1); | ||
339 | } | 345 | } |
340 | return; | 346 | return; |
341 | } else { | 347 | } else { |