summaryrefslogtreecommitdiffstats
path: root/sway/commands.c
diff options
context:
space:
mode:
authorLibravatar D.B <thejan.2009@gmail.com>2016-07-07 22:28:57 +0200
committerLibravatar D.B <thejan.2009@gmail.com>2016-07-07 22:28:57 +0200
commitee67cd0ba1e950f5e21328580cc46b618be5fc01 (patch)
tree20a270ed04829763c56c854f7b3978cf4b640e5d /sway/commands.c
parentMerge pull request #739 from deklov/swaybar-pointer-01 (diff)
downloadsway-ee67cd0ba1e950f5e21328580cc46b618be5fc01.tar.gz
sway-ee67cd0ba1e950f5e21328580cc46b618be5fc01.tar.zst
sway-ee67cd0ba1e950f5e21328580cc46b618be5fc01.zip
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.c4
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) {
1950 } 1950 }
1951 1951
1952 if (strcasecmp(argv[0], "tabbed") == 0) { 1952 if (strcasecmp(argv[0], "tabbed") == 0) {
1953 if (parent->type != C_CONTAINER) { 1953 if (parent->type != C_CONTAINER && !swayc_is_empty_workspace(parent)){
1954 parent = new_container(parent, L_TABBED); 1954 parent = new_container(parent, L_TABBED);
1955 } 1955 }
1956 1956
1957 parent->layout = L_TABBED; 1957 parent->layout = L_TABBED;
1958 } else if (strcasecmp(argv[0], "stacking") == 0) { 1958 } else if (strcasecmp(argv[0], "stacking") == 0) {
1959 if (parent->type != C_CONTAINER) { 1959 if (parent->type != C_CONTAINER && !swayc_is_empty_workspace(parent)) {
1960 parent = new_container(parent, L_STACKED); 1960 parent = new_container(parent, L_STACKED);
1961 } 1961 }
1962 1962