diff options
author | 2016-11-17 06:49:12 +0100 | |
---|---|---|
committer | 2016-12-04 08:31:34 -0500 | |
commit | 35b8d185ac58eaaeb12a95d6947cdcb78a2ee487 (patch) | |
tree | fdfeef48c18a9a484b7491d38a6ee0be12801f7c /sway | |
parent | wrap some views under workspaces (diff) | |
download | sway-35b8d185ac58eaaeb12a95d6947cdcb78a2ee487.tar.gz sway-35b8d185ac58eaaeb12a95d6947cdcb78a2ee487.tar.zst sway-35b8d185ac58eaaeb12a95d6947cdcb78a2ee487.zip |
fix layout switching (was broken because of workspace_layout)0.11-rc1
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')
-rw-r--r-- | sway/commands/layout.c | 2 | ||||
-rw-r--r-- | sway/container.c | 3 |
2 files changed, 4 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) { | |||
49 | } else if (strcasecmp(argv[0], "splitv") == 0) { | 49 | } else if (strcasecmp(argv[0], "splitv") == 0) { |
50 | swayc_change_layout(parent, L_VERT); | 50 | swayc_change_layout(parent, L_VERT); |
51 | } else if (strcasecmp(argv[0], "toggle") == 0 && argc == 2 && strcasecmp(argv[1], "split") == 0) { | 51 | } else if (strcasecmp(argv[0], "toggle") == 0 && argc == 2 && strcasecmp(argv[1], "split") == 0) { |
52 | if (parent->layout == L_HORIZ) { | 52 | if (parent->layout == L_HORIZ && (parent->workspace_layout == L_NONE || parent->workspace_layout == L_HORIZ)) { |
53 | swayc_change_layout(parent, L_VERT); | 53 | swayc_change_layout(parent, L_VERT); |
54 | } else { | 54 | } else { |
55 | swayc_change_layout(parent, L_HORIZ); | 55 | swayc_change_layout(parent, L_HORIZ); |
diff --git a/sway/container.c b/sway/container.c index c588f3db..e5284200 100644 --- a/sway/container.c +++ b/sway/container.c | |||
@@ -950,6 +950,9 @@ swayc_t *swayc_tabbed_stacked_parent(swayc_t *con) { | |||
950 | swayc_t *swayc_change_layout(swayc_t *container, enum swayc_layouts layout) { | 950 | swayc_t *swayc_change_layout(swayc_t *container, enum swayc_layouts layout) { |
951 | if (container->type == C_WORKSPACE) { | 951 | if (container->type == C_WORKSPACE) { |
952 | container->workspace_layout = layout; | 952 | container->workspace_layout = layout; |
953 | if (layout == L_HORIZ || layout == L_VERT) { | ||
954 | container->layout = layout; | ||
955 | } | ||
953 | } else { | 956 | } else { |
954 | container->layout = layout; | 957 | container->layout = layout; |
955 | } | 958 | } |