From d26658fb355fdf7feee2d6aa801e487502e6ce8b Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Fri, 1 Apr 2016 15:58:29 +0200 Subject: Correctly determine default layout --- sway/layout.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sway/layout.c') 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; + } +} -- cgit v1.2.3