aboutsummaryrefslogtreecommitdiff
path: root/sway/commands
diff options
context:
space:
mode:
authorTudor Brindus <me@tbrindus.ca>2020-07-01 01:08:04 -0400
committerBrian Ashworth <bosrsf04@gmail.com>2020-07-01 18:43:20 -0400
commit92891fb1edef5136ae4eb35fec5b8523f031be81 (patch)
tree859ad6d0d7a0dae214bdfff7f0bf3263885a2ed8 /sway/commands
parent105bf23998e76bf88c577aa92b3afd1fe228b1bc (diff)
downloadsway-92891fb1edef5136ae4eb35fec5b8523f031be81.tar.xz
commands/move: unwrap workspace container on move to new workspace
If moving e.g. `T[app app]` into a new workspace with `workspace_layout tabbed`, then post-move the tree in that workspace will be `T[T[app app]]`. This still happens with horizontal or vertical workspace layout, but is less visible since those containers have no decorations. Fixes #5426.
Diffstat (limited to 'sway/commands')
-rw-r--r--sway/commands/move.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c
index cdbad13e..5851520e 100644
--- a/sway/commands/move.c
+++ b/sway/commands/move.c
@@ -208,9 +208,13 @@ static void container_move_to_workspace(struct sway_container *container,
}
} else {
container_detach(container);
- container->width = container->height = 0;
- container->width_fraction = container->height_fraction = 0;
- workspace_add_tiling(workspace, container);
+ if (workspace_is_empty(workspace) && container->children) {
+ workspace_unwrap_children(workspace, container);
+ } else {
+ container->width = container->height = 0;
+ container->width_fraction = container->height_fraction = 0;
+ workspace_add_tiling(workspace, container);
+ }
container_update_representation(container);
}
if (container->view) {