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 Simon Ser <contact@emersion.fr>2020-07-15 19:22:05 +0200
commit472dce662116bb13101e27ecb4b05b803ee21e64 (patch)
tree4c700eadf38f81594f5d373de9990ee80c05188d /sway/commands/move.c
parentUpdate version to v1.5-rc2 (diff)
downloadsway-472dce662116bb13101e27ecb4b05b803ee21e64.tar.gz
sway-472dce662116bb13101e27ecb4b05b803ee21e64.tar.zst
sway-472dce662116bb13101e27ecb4b05b803ee21e64.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. (cherry picked from commit 92891fb1edef5136ae4eb35fec5b8523f031be81)
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) {