diff options
author | 2016-04-01 15:58:29 +0200 | |
---|---|---|
committer | 2016-04-25 00:00:49 +0200 | |
commit | d26658fb355fdf7feee2d6aa801e487502e6ce8b (patch) | |
tree | 1879cf81d8e55b676bbd4a5b44dd23d5d93e8b5f /sway/layout.c | |
parent | Fix problems with floating windows (diff) | |
download | sway-d26658fb355fdf7feee2d6aa801e487502e6ce8b.tar.gz sway-d26658fb355fdf7feee2d6aa801e487502e6ce8b.tar.zst sway-d26658fb355fdf7feee2d6aa801e487502e6ce8b.zip |
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 | |||
993 | } | 993 | } |
994 | } | 994 | } |
995 | } | 995 | } |
996 | |||
997 | enum swayc_layouts default_layout(swayc_t *output) { | ||
998 | if (config->default_layout != L_NONE) { | ||
999 | return config->default_layout; | ||
1000 | } else if (config->default_orientation != L_NONE) { | ||
1001 | return config->default_orientation; | ||
1002 | } else if (output->width >= output->height) { | ||
1003 | return L_HORIZ; | ||
1004 | } else { | ||
1005 | return L_VERT; | ||
1006 | } | ||
1007 | } | ||