aboutsummaryrefslogtreecommitdiff
path: root/sway/handlers.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-08-27 22:55:07 -0400
committerDrew DeVault <sir@cmpwn.com>2015-08-27 22:55:07 -0400
commit930d136196f12fc13380c68058c52d86107561cd (patch)
tree7aac4f1730b810fbe620ba5e70e15a51c46d24d5 /sway/handlers.c
parent0a74364656ff7e36d276373a3e159e86784363d7 (diff)
parentacb3fbdfb559e461aaac6d357146f43c4e9c3d38 (diff)
Merge pull request #144 from Luminarys/master
Added in default_orientation handling
Diffstat (limited to 'sway/handlers.c')
-rw-r--r--sway/handlers.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index 2223a98c..aa336e8d 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -130,6 +130,13 @@ static void handle_output_resolution_change(wlc_handle output, const struct wlc_
if (!c) return;
c->width = to->w;
c->height = to->h;
+ if (config->default_layout == L_NONE && config->default_orientation == L_NONE) {
+ if (c->width >= c->height) {
+ ((swayc_t*)c->children->items[0])->layout = L_HORIZ;
+ } else {
+ ((swayc_t*)c->children->items[0])->layout = L_VERT;
+ }
+ }
arrange_windows(&root_container, -1, -1);
}