diff options
author | D.B <thejan.2009@gmail.com> | 2016-07-07 22:28:57 +0200 |
---|---|---|
committer | D.B <thejan.2009@gmail.com> | 2016-07-07 22:28:57 +0200 |
commit | ee67cd0ba1e950f5e21328580cc46b618be5fc01 (patch) | |
tree | 20a270ed04829763c56c854f7b3978cf4b640e5d /sway/commands.c | |
parent | 378149b59c8d2a6d2b0bab7f2bb507dbac990734 (diff) |
Fix tabbed/stacked corner case #742
Tabbed/stacked containers are now created only if a view is present on
the workspace. If a view is created on previously empty tabbed/stacked
workspace, it gets wrapped in a container.
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/commands.c b/sway/commands.c index 2248e1c7..871b3078 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -1950,13 +1950,13 @@ static struct cmd_results *cmd_layout(int argc, char **argv) { } if (strcasecmp(argv[0], "tabbed") == 0) { - if (parent->type != C_CONTAINER) { + if (parent->type != C_CONTAINER && !swayc_is_empty_workspace(parent)){ parent = new_container(parent, L_TABBED); } parent->layout = L_TABBED; } else if (strcasecmp(argv[0], "stacking") == 0) { - if (parent->type != C_CONTAINER) { + if (parent->type != C_CONTAINER && !swayc_is_empty_workspace(parent)) { parent = new_container(parent, L_STACKED); } |