diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2019-04-24 20:28:19 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-04-24 19:12:24 -0600 |
commit | 462ad4ea8380f29ad7a81d65bc144cb0ac6f5d8f (patch) | |
tree | 7d83afea78abc6b9e754b05e156ab25b22dce972 /sway/tree/container.c | |
parent | swaybar: add multiseat support (diff) | |
download | sway-462ad4ea8380f29ad7a81d65bc144cb0ac6f5d8f.tar.gz sway-462ad4ea8380f29ad7a81d65bc144cb0ac6f5d8f.tar.zst sway-462ad4ea8380f29ad7a81d65bc144cb0ac6f5d8f.zip |
cmd_move: respect workspace layout when inserting
When moving a container to become a direct child of the workspace and
the workspace's layout is tabbed or stacked, wrap it in a container
with the same layout. This allows for the following:
- Run `layout tabbed|stacked` on an empty workspace (or use
`workspace_layout tabbed|stacked` in the config)
- Open some views
- Move one of the views in any direction
- Open another view
- The new container should also be `tabbed`/`stacked`
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r-- | sway/tree/container.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 11ed4f98..c4d21f0a 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -1385,8 +1385,10 @@ void container_replace(struct sway_container *container, | |||
1385 | root_scratchpad_show(container); | 1385 | root_scratchpad_show(container); |
1386 | root_scratchpad_remove_container(container); | 1386 | root_scratchpad_remove_container(container); |
1387 | } | 1387 | } |
1388 | container_add_sibling(container, replacement, 1); | 1388 | if (container->parent || container->workspace) { |
1389 | container_detach(container); | 1389 | container_add_sibling(container, replacement, 1); |
1390 | container_detach(container); | ||
1391 | } | ||
1390 | if (scratchpad) { | 1392 | if (scratchpad) { |
1391 | root_scratchpad_add_container(replacement); | 1393 | root_scratchpad_add_container(replacement); |
1392 | } | 1394 | } |