diff options
author | Tudor Brindus <me@tbrindus.ca> | 2020-07-01 03:20:38 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-07-15 19:27:12 +0200 |
commit | 83382f0b4ebcfeb05da57b6432cb2c08e30dde5c (patch) | |
tree | 251c7e6cab7542d6f3527251dafb2ae4838e2a2b /sway/commands/move.c | |
parent | Replace unprintable characters in input device id (diff) | |
download | sway-83382f0b4ebcfeb05da57b6432cb2c08e30dde5c.tar.gz sway-83382f0b4ebcfeb05da57b6432cb2c08e30dde5c.tar.zst sway-83382f0b4ebcfeb05da57b6432cb2c08e30dde5c.zip |
commands/move: maintain workspace_layout when moving
Fixes #5157.
(cherry picked from commit b4a75a1ab2a72842830aeea37733311f85e6f660)
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 | } |