aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/move.c
diff options
context:
space:
mode:
authorLibravatar Tudor Brindus <me@tbrindus.ca>2020-07-01 01:08:04 -0400
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2020-07-01 18:43:20 -0400
commit92891fb1edef5136ae4eb35fec5b8523f031be81 (patch)
tree859ad6d0d7a0dae214bdfff7f0bf3263885a2ed8 /sway/commands/move.c
parentMinor wording changes in Romanian README.md translation (diff)
downloadsway-92891fb1edef5136ae4eb35fec5b8523f031be81.tar.gz
sway-92891fb1edef5136ae4eb35fec5b8523f031be81.tar.zst
sway-92891fb1edef5136ae4eb35fec5b8523f031be81.zip
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/move.c')
-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,
208 } 208 }
209 } else { 209 } else {
210 container_detach(container); 210 container_detach(container);
211 container->width = container->height = 0; 211 if (workspace_is_empty(workspace) && container->children) {
212 container->width_fraction = container->height_fraction = 0; 212 workspace_unwrap_children(workspace, container);
213 workspace_add_tiling(workspace, container); 213 } else {
214 container->width = container->height = 0;
215 container->width_fraction = container->height_fraction = 0;
216 workspace_add_tiling(workspace, container);
217 }
214 container_update_representation(container); 218 container_update_representation(container);
215 } 219 }
216 if (container->view) { 220 if (container->view) {