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.
This commit is contained in:
D.B 2016-07-07 22:28:57 +02:00
parent 378149b59c
commit ee67cd0ba1
4 changed files with 22 additions and 3 deletions

View file

@ -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);
}