aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/layout.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2016-10-12 21:26:06 -0400
committerLibravatar GitHub <noreply@github.com>2016-10-12 21:26:06 -0400
commit4cba91803eb8c3c3ab4ebf22e94510b43f7a907d (patch)
tree5f80bbe3775f0e405895ab973c62f8bbd8ea1bf8 /sway/commands/layout.c
parentMerge pull request #952 from SirCmpwn/revert-948-floating-titlebar-click (diff)
downloadsway-4cba91803eb8c3c3ab4ebf22e94510b43f7a907d.tar.gz
sway-4cba91803eb8c3c3ab4ebf22e94510b43f7a907d.tar.zst
sway-4cba91803eb8c3c3ab4ebf22e94510b43f7a907d.zip
Revert "Fixes dealing with workspace_layout and related bugs [rfc]"
Diffstat (limited to 'sway/commands/layout.c')
-rw-r--r--sway/commands/layout.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sway/commands/layout.c b/sway/commands/layout.c
index a716f9be..e0af30aa 100644
--- a/sway/commands/layout.c
+++ b/sway/commands/layout.c
@@ -22,10 +22,10 @@ struct cmd_results *cmd_layout(int argc, char **argv) {
22 enum swayc_layouts old_layout = parent->layout; 22 enum swayc_layouts old_layout = parent->layout;
23 23
24 if (strcasecmp(argv[0], "default") == 0) { 24 if (strcasecmp(argv[0], "default") == 0) {
25 swayc_change_layout(parent, parent->prev_layout); 25 parent->layout = parent->prev_layout;
26 if (parent->layout == L_NONE) { 26 if (parent->layout == L_NONE) {
27 swayc_t *output = swayc_parent_by_type(parent, C_OUTPUT); 27 swayc_t *output = swayc_parent_by_type(parent, C_OUTPUT);
28 swayc_change_layout(parent, default_layout(output)); 28 parent->layout = default_layout(output);
29 } 29 }
30 } else { 30 } else {
31 if (parent->layout != L_TABBED && parent->layout != L_STACKED) { 31 if (parent->layout != L_TABBED && parent->layout != L_STACKED) {
@@ -37,22 +37,22 @@ struct cmd_results *cmd_layout(int argc, char **argv) {
37 parent = new_container(parent, L_TABBED); 37 parent = new_container(parent, L_TABBED);
38 } 38 }
39 39
40 swayc_change_layout(parent, L_TABBED); 40 parent->layout = L_TABBED;
41 } else if (strcasecmp(argv[0], "stacking") == 0) { 41 } else if (strcasecmp(argv[0], "stacking") == 0) {
42 if (parent->type != C_CONTAINER && !swayc_is_empty_workspace(parent)) { 42 if (parent->type != C_CONTAINER && !swayc_is_empty_workspace(parent)) {
43 parent = new_container(parent, L_STACKED); 43 parent = new_container(parent, L_STACKED);
44 } 44 }
45 45
46 swayc_change_layout(parent, L_STACKED); 46 parent->layout = L_STACKED;
47 } else if (strcasecmp(argv[0], "splith") == 0) { 47 } else if (strcasecmp(argv[0], "splith") == 0) {
48 swayc_change_layout(parent, L_HORIZ); 48 parent->layout = L_HORIZ;
49 } else if (strcasecmp(argv[0], "splitv") == 0) { 49 } else if (strcasecmp(argv[0], "splitv") == 0) {
50 swayc_change_layout(parent, L_VERT); 50 parent->layout = 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_VERT) { 52 if (parent->layout == L_VERT) {
53 swayc_change_layout(parent, L_HORIZ); 53 parent->layout = L_HORIZ;
54 } else { 54 } else {
55 swayc_change_layout(parent, L_VERT); 55 parent->layout = L_VERT;
56 } 56 }
57 } 57 }
58 } 58 }