diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-04-03 13:16:23 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2018-04-03 13:16:23 -0400 |
commit | 065887bb7b25c1cf7d39459c79387a24e600085f (patch) | |
tree | 7958aed61c6c3c47fc3849434ad09dcbd6b53f65 /sway/tree/layout.c | |
parent | fcbcbf34adbcfbfc4107c5e0050639828265e122 (diff) |
move container_set_layout to layout.h
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r-- | sway/tree/layout.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 487f895f..dfcdbb9c 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c @@ -47,6 +47,19 @@ static void output_layout_change_notify(struct wl_listener *listener, arrange_windows(&root_container, -1, -1); } +struct sway_container *container_set_layout(struct sway_container *container, + enum sway_container_layout layout) { + if (container->type == C_WORKSPACE) { + container->workspace_layout = layout; + if (layout == L_HORIZ || layout == L_VERT) { + container->layout = layout; + } + } else { + container->layout = layout; + } + return container; +} + void layout_init(void) { root_container.id = 0; // normally assigned in new_swayc() root_container.type = C_ROOT; |