diff options
author | Luminarys <kizunanohikari@gmail.com> | 2015-08-27 21:52:59 -0500 |
---|---|---|
committer | Luminarys <kizunanohikari@gmail.com> | 2015-08-27 21:52:59 -0500 |
commit | acb3fbdfb559e461aaac6d357146f43c4e9c3d38 (patch) | |
tree | 7aac4f1730b810fbe620ba5e70e15a51c46d24d5 /sway/container.c | |
parent | 0a74364656ff7e36d276373a3e159e86784363d7 (diff) |
Added in default_orientation handling
Diffstat (limited to 'sway/container.c')
-rw-r--r-- | sway/container.c | 11 |
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; |