aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/layout.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2018-03-29 23:41:33 -0400
committerLibravatar Tony Crisci <tony@dubstepdish.com>2018-03-29 23:41:33 -0400
commitdc8c9fbeb664518c76066cc28ee29452c6c30128 (patch)
tree88c2de0d08e00b2a30cb20cdfadfa6e53f5c59b4 /sway/commands/layout.c
parentMerge pull request #1653 from swaywm/revert-1647-refactor-tree (diff)
downloadsway-dc8c9fbeb664518c76066cc28ee29452c6c30128.tar.gz
sway-dc8c9fbeb664518c76066cc28ee29452c6c30128.tar.zst
sway-dc8c9fbeb664518c76066cc28ee29452c6c30128.zip
Revert "Merge pull request #1653 from swaywm/revert-1647-refactor-tree"
Diffstat (limited to 'sway/commands/layout.c')
-rw-r--r--sway/commands/layout.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sway/commands/layout.c b/sway/commands/layout.c
index b0fc5d66..ebab2a48 100644
--- a/sway/commands/layout.c
+++ b/sway/commands/layout.c
@@ -1,8 +1,8 @@
1#include <string.h> 1#include <string.h>
2#include <strings.h> 2#include <strings.h>
3#include "sway/commands.h" 3#include "sway/commands.h"
4#include "sway/container.h" 4#include "sway/tree/container.h"
5#include "sway/layout.h" 5#include "sway/tree/layout.h"
6#include "log.h" 6#include "log.h"
7 7
8struct cmd_results *cmd_layout(int argc, char **argv) { 8struct cmd_results *cmd_layout(int argc, char **argv) {
@@ -10,7 +10,7 @@ struct cmd_results *cmd_layout(int argc, char **argv) {
10 if ((error = checkarg(argc, "layout", EXPECTED_MORE_THAN, 0))) { 10 if ((error = checkarg(argc, "layout", EXPECTED_MORE_THAN, 0))) {
11 return error; 11 return error;
12 } 12 }
13 swayc_t *parent = config->handler_context.current_container; 13 struct sway_container *parent = config->handler_context.current_container;
14 14
15 // TODO: floating 15 // TODO: floating
16 /* 16 /*
@@ -26,10 +26,10 @@ 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 swayc_change_layout(parent, parent->prev_layout); 29 container_set_layout(parent, parent->prev_layout);
30 if (parent->layout == L_NONE) { 30 if (parent->layout == L_NONE) {
31 swayc_t *output = swayc_parent_by_type(parent, C_OUTPUT); 31 struct sway_container *output = container_parent(parent, C_OUTPUT);
32 swayc_change_layout(parent, default_layout(output)); 32 container_set_layout(parent, container_get_default_layout(output));
33 } 33 }
34 } else { 34 } else {
35 if (parent->layout != L_TABBED && parent->layout != L_STACKED) { 35 if (parent->layout != L_TABBED && parent->layout != L_STACKED) {
@@ -37,15 +37,15 @@ struct cmd_results *cmd_layout(int argc, char **argv) {
37 } 37 }
38 38
39 if (strcasecmp(argv[0], "splith") == 0) { 39 if (strcasecmp(argv[0], "splith") == 0) {
40 swayc_change_layout(parent, L_HORIZ); 40 container_set_layout(parent, L_HORIZ);
41 } else if (strcasecmp(argv[0], "splitv") == 0) { 41 } else if (strcasecmp(argv[0], "splitv") == 0) {
42 swayc_change_layout(parent, L_VERT); 42 container_set_layout(parent, L_VERT);
43 } else if (strcasecmp(argv[0], "toggle") == 0 && argc == 2 && strcasecmp(argv[1], "split") == 0) { 43 } else if (strcasecmp(argv[0], "toggle") == 0 && argc == 2 && strcasecmp(argv[1], "split") == 0) {
44 if (parent->layout == L_HORIZ && (parent->workspace_layout == L_NONE 44 if (parent->layout == L_HORIZ && (parent->workspace_layout == L_NONE
45 || parent->workspace_layout == L_HORIZ)) { 45 || parent->workspace_layout == L_HORIZ)) {
46 swayc_change_layout(parent, L_VERT); 46 container_set_layout(parent, L_VERT);
47 } else { 47 } else {
48 swayc_change_layout(parent, L_HORIZ); 48 container_set_layout(parent, L_HORIZ);
49 } 49 }
50 } 50 }
51 } 51 }