aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/workspace.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-04-24 20:28:19 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-04-24 19:12:24 -0600
commit462ad4ea8380f29ad7a81d65bc144cb0ac6f5d8f (patch)
tree7d83afea78abc6b9e754b05e156ab25b22dce972 /sway/tree/workspace.c
parentswaybar: add multiseat support (diff)
downloadsway-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/workspace.c')
-rw-r--r--sway/tree/workspace.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c
index 68a55e03..1a1f5c49 100644
--- a/sway/tree/workspace.c
+++ b/sway/tree/workspace.c
@@ -688,6 +688,9 @@ void workspace_insert_tiling(struct sway_workspace *workspace,
688 if (con->workspace) { 688 if (con->workspace) {
689 container_detach(con); 689 container_detach(con);
690 } 690 }
691 if (workspace->layout == L_STACKED || workspace->layout == L_TABBED) {
692 con = container_split(con, workspace->layout);
693 }
691 list_insert(workspace->tiling, index, con); 694 list_insert(workspace->tiling, index, con);
692 con->workspace = workspace; 695 con->workspace = workspace;
693 container_for_each_child(con, set_workspace, NULL); 696 container_for_each_child(con, set_workspace, NULL);