diff options
Diffstat (limited to 'sway/commands/move.c')
-rw-r--r-- | sway/commands/move.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c index 5851520e..03839083 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c | |||
@@ -275,12 +275,11 @@ static void workspace_rejigger(struct sway_workspace *ws, | |||
275 | return; | 275 | return; |
276 | } | 276 | } |
277 | container_detach(child); | 277 | container_detach(child); |
278 | struct sway_container *new_parent = workspace_wrap_children(ws); | 278 | workspace_wrap_children(ws); |
279 | 279 | ||
280 | int index = | 280 | int index = |
281 | move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_UP ? 0 : 1; | 281 | move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_UP ? 0 : 1; |
282 | workspace_insert_tiling(ws, child, index); | 282 | workspace_insert_tiling(ws, child, index); |
283 | container_flatten(new_parent); | ||
284 | ws->layout = | 283 | ws->layout = |
285 | move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_RIGHT ? | 284 | move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_RIGHT ? |
286 | L_HORIZ : L_VERT; | 285 | L_HORIZ : L_VERT; |
@@ -349,8 +348,11 @@ static bool container_move_in_direction(struct sway_container *container, | |||
349 | container_insert_child(current->parent, container, | 348 | container_insert_child(current->parent, container, |
350 | index + (offs < 0 ? 0 : 1)); | 349 | index + (offs < 0 ? 0 : 1)); |
351 | } else { | 350 | } else { |
352 | workspace_insert_tiling(current->workspace, container, | 351 | struct sway_workspace *ws = current->workspace; |
353 | index + (offs < 0 ? 0 : 1)); | 352 | workspace_insert_tiling(ws, |
353 | container_split(container, | ||
354 | output_get_default_layout(ws->output)), | ||
355 | index + (offs < 0 ? 0 : 1)); | ||
354 | } | 356 | } |
355 | return true; | 357 | return true; |
356 | } | 358 | } |