diff options
author | Tudor Brindus <me@tbrindus.ca> | 2020-07-01 03:20:38 -0400 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2020-07-03 18:40:59 -0400 |
commit | b4a75a1ab2a72842830aeea37733311f85e6f660 (patch) | |
tree | f011ff5d7040f33c3ac1c0b858c59e39260f9fbb /sway/commands | |
parent | 17ff13fc84fd74ddcee68a302af156d7bf81ed85 (diff) | |
download | sway-b4a75a1ab2a72842830aeea37733311f85e6f660.tar.xz |
commands/move: maintain workspace_layout when moving
Fixes #5157.
Diffstat (limited to 'sway/commands')
-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, return; } container_detach(child); - struct sway_container *new_parent = workspace_wrap_children(ws); + workspace_wrap_children(ws); int index = move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_UP ? 0 : 1; workspace_insert_tiling(ws, child, index); - container_flatten(new_parent); ws->layout = move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_RIGHT ? L_HORIZ : L_VERT; @@ -349,8 +348,11 @@ static bool container_move_in_direction(struct sway_container *container, container_insert_child(current->parent, container, index + (offs < 0 ? 0 : 1)); } else { - workspace_insert_tiling(current->workspace, container, - index + (offs < 0 ? 0 : 1)); + struct sway_workspace *ws = current->workspace; + workspace_insert_tiling(ws, + container_split(container, + output_get_default_layout(ws->output)), + index + (offs < 0 ? 0 : 1)); } return true; } |