aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Ronan Pigott <rpigott@berkeley.edu>2020-10-23 17:08:30 -0700
committerLibravatar Tudor Brindus <me@tbrindus.ca>2020-12-20 00:58:42 -0500
commitd54c8e885b8bfc6b9922c575d77a5fbe2ac8a60a (patch)
tree90c980cc5a591d0ffe0f68865f49ac0100107892
parentcontainer: don't split single children (diff)
downloadsway-d54c8e885b8bfc6b9922c575d77a5fbe2ac8a60a.tar.gz
sway-d54c8e885b8bfc6b9922c575d77a5fbe2ac8a60a.tar.zst
sway-d54c8e885b8bfc6b9922c575d77a5fbe2ac8a60a.zip
commands/layout: don't change the layout of workspaces with children
In i3 the layout command on a workspace affects the workspace layout only on empty workspaces. Otherwise children are placed in a new container with the desired layout to preserve the workspace layout.
-rw-r--r--sway/commands/layout.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sway/commands/layout.c b/sway/commands/layout.c
index 4b31b442..f2af183b 100644
--- a/sway/commands/layout.c
+++ b/sway/commands/layout.c
@@ -162,6 +162,12 @@ struct cmd_results *cmd_layout(int argc, char **argv) {
162 } 162 }
163 container->layout = new_layout; 163 container->layout = new_layout;
164 container_update_representation(container); 164 container_update_representation(container);
165 } else if (config->handler_context.container) {
166 // i3 avoids changing workspace layouts with a new container
167 // https://github.com/i3/i3/blob/3cd1c45eba6de073bc4300eebb4e1cc1a0c4479a/src/con.c#L1817
168 container = workspace_wrap_children(workspace);
169 container->layout = new_layout;
170 container_update_representation(container);
165 } else { 171 } else {
166 if (old_layout != L_TABBED && old_layout != L_STACKED) { 172 if (old_layout != L_TABBED && old_layout != L_STACKED) {
167 workspace->prev_split_layout = old_layout; 173 workspace->prev_split_layout = old_layout;