diff options
Diffstat (limited to 'sway/commands/layout.c')
-rw-r--r-- | sway/commands/layout.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sway/commands/layout.c b/sway/commands/layout.c index 4c49a627..ca45a6c8 100644 --- a/sway/commands/layout.c +++ b/sway/commands/layout.c | |||
@@ -26,9 +26,9 @@ struct cmd_results *cmd_layout(int argc, char **argv) { | |||
26 | // TODO: stacks and tabs | 26 | // TODO: stacks and tabs |
27 | 27 | ||
28 | if (strcasecmp(argv[0], "default") == 0) { | 28 | if (strcasecmp(argv[0], "default") == 0) { |
29 | container_set_layout(parent, parent->prev_layout); | 29 | parent->layout = parent->prev_layout; |
30 | if (parent->layout == L_NONE) { | 30 | if (parent->layout == L_NONE) { |
31 | container_set_layout(parent, container_get_default_layout(parent)); | 31 | parent->layout = container_get_default_layout(parent); |
32 | } | 32 | } |
33 | } else { | 33 | } else { |
34 | if (parent->layout != L_TABBED && parent->layout != L_STACKED) { | 34 | if (parent->layout != L_TABBED && parent->layout != L_STACKED) { |
@@ -36,15 +36,14 @@ struct cmd_results *cmd_layout(int argc, char **argv) { | |||
36 | } | 36 | } |
37 | 37 | ||
38 | if (strcasecmp(argv[0], "splith") == 0) { | 38 | if (strcasecmp(argv[0], "splith") == 0) { |
39 | container_set_layout(parent, L_HORIZ); | 39 | parent->layout = L_HORIZ; |
40 | } else if (strcasecmp(argv[0], "splitv") == 0) { | 40 | } else if (strcasecmp(argv[0], "splitv") == 0) { |
41 | container_set_layout(parent, L_VERT); | 41 | parent->layout = L_VERT; |
42 | } else if (strcasecmp(argv[0], "toggle") == 0 && argc == 2 && strcasecmp(argv[1], "split") == 0) { | 42 | } else if (strcasecmp(argv[0], "toggle") == 0 && argc == 2 && strcasecmp(argv[1], "split") == 0) { |
43 | if (parent->layout == L_HORIZ && (parent->workspace_layout == L_NONE | 43 | if (parent->layout == L_HORIZ) { |
44 | || parent->workspace_layout == L_HORIZ)) { | 44 | parent->layout = L_VERT; |
45 | container_set_layout(parent, L_VERT); | ||
46 | } else { | 45 | } else { |
47 | container_set_layout(parent, L_HORIZ); | 46 | parent->layout = L_HORIZ; |
48 | } | 47 | } |
49 | } | 48 | } |
50 | } | 49 | } |