aboutsummaryrefslogtreecommitdiff
path: root/sway/container.c
diff options
context:
space:
mode:
authorLuminarys <kizunanohikari@gmail.com>2015-08-27 21:52:59 -0500
committerLuminarys <kizunanohikari@gmail.com>2015-08-27 21:52:59 -0500
commitacb3fbdfb559e461aaac6d357146f43c4e9c3d38 (patch)
tree7aac4f1730b810fbe620ba5e70e15a51c46d24d5 /sway/container.c
parent0a74364656ff7e36d276373a3e159e86784363d7 (diff)
Added in default_orientation handling
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sway/container.c b/sway/container.c
index 05bb6abb..abbd5504 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -146,7 +146,16 @@ swayc_t *new_workspace(swayc_t *output, const char *name) {
sway_log(L_DEBUG, "Added workspace %s for output %u", name, (unsigned int)output->handle);
swayc_t *workspace = new_swayc(C_WORKSPACE);
- workspace->layout = L_HORIZ; // TODO: default layout
+ // TODO: default_layout
+ if (config->default_layout != L_NONE) {
+ workspace->layout = config->default_layout;
+ } else if (config->default_orientation != L_NONE) {
+ workspace->layout = config->default_orientation;
+ } else if (output->width >= output->height) {
+ workspace->layout = L_HORIZ;
+ } else {
+ workspace->layout = L_VERT;
+ }
workspace->x = output->x;
workspace->y = output->y;
workspace->width = output->width;