diff options
author | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-04-01 15:58:29 +0200 |
---|---|---|
committer | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-04-25 00:00:49 +0200 |
commit | d26658fb355fdf7feee2d6aa801e487502e6ce8b (patch) | |
tree | 1879cf81d8e55b676bbd4a5b44dd23d5d93e8b5f /sway/layout.c | |
parent | 8d700fe008ccf9f7eb4664e236277c9f30a449fb (diff) |
Correctly determine default layout
Diffstat (limited to 'sway/layout.c')
-rw-r--r-- | sway/layout.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sway/layout.c b/sway/layout.c index 527579d9..261e2138 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -993,3 +993,15 @@ void recursive_resize(swayc_t *container, double amount, enum wlc_resize_edge ed } } } + +enum swayc_layouts default_layout(swayc_t *output) { + if (config->default_layout != L_NONE) { + return config->default_layout; + } else if (config->default_orientation != L_NONE) { + return config->default_orientation; + } else if (output->width >= output->height) { + return L_HORIZ; + } else { + return L_VERT; + } +} |