aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/layout.c
diff options
context:
space:
mode:
authorD.B <thejan.2009@gmail.com>2016-11-17 06:49:12 +0100
committerDrew DeVault <sir@cmpwn.com>2016-12-04 08:31:34 -0500
commit35b8d185ac58eaaeb12a95d6947cdcb78a2ee487 (patch)
treefdfeef48c18a9a484b7491d38a6ee0be12801f7c /sway/commands/layout.c
parent4762bcb3b9a1b9043ce78c7765d4513b0c5da635 (diff)
fix layout switching (was broken because of workspace_layout)
For workspace containers, swayc_change_layout also changes ->layout alongside ->workspace_layout when it's a sensible thing to do. There is an additional test for 'layout toggle' command which ensures that containers will be tiled horizontally after toggling from tabbed or stacked.
Diffstat (limited to 'sway/commands/layout.c')
-rw-r--r--sway/commands/layout.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/commands/layout.c b/sway/commands/layout.c
index bef06cb2..08336150 100644
--- a/sway/commands/layout.c
+++ b/sway/commands/layout.c
@@ -49,7 +49,7 @@ struct cmd_results *cmd_layout(int argc, char **argv) {
} else if (strcasecmp(argv[0], "splitv") == 0) {
swayc_change_layout(parent, L_VERT);
} else if (strcasecmp(argv[0], "toggle") == 0 && argc == 2 && strcasecmp(argv[1], "split") == 0) {
- if (parent->layout == L_HORIZ) {
+ if (parent->layout == L_HORIZ && (parent->workspace_layout == L_NONE || parent->workspace_layout == L_HORIZ)) {
swayc_change_layout(parent, L_VERT);
} else {
swayc_change_layout(parent, L_HORIZ);