From ee67cd0ba1e950f5e21328580cc46b618be5fc01 Mon Sep 17 00:00:00 2001 From: "D.B" Date: Thu, 7 Jul 2016 22:28:57 +0200 Subject: 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. --- sway/commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sway/commands.c') 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); } -- cgit v1.2.3