From b922e1cb29198c841d81090542d309e2be6f8ba9 Mon Sep 17 00:00:00 2001 From: jdiez17 Date: Mon, 10 Aug 2015 02:39:54 +0200 Subject: [PATCH] fullscreen: partially working --- sway/layout.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/sway/layout.c b/sway/layout.c index 2913daa93..affcb83e9 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -41,11 +41,30 @@ void arrange_windows(swayc_t *container, int width, int height) { } return; case C_VIEW: - sway_log(L_DEBUG, "Setting view to %d x %d @ %d, %d", width, height, container->x, container->y); // If the view is fullscreen, we need to tell wlc to draw it as such - if (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN > 0) { - sway_log(L_DEBUG, "window is fullscreen!"); + if (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN) { + swayc_t *parent = container; + do { + parent = parent->parent; + } while(parent->type != C_OUTPUT); + + sway_log(L_DEBUG, "res %d %d", parent->width, parent->height); + struct wlc_geometry geometry = { + .origin = { + .x = 0, + .y = 0 + }, + .size = { + .w = parent->width, + .h = parent->height + } + }; + + wlc_view_set_geometry(container->handle, &geometry); + return; } + + sway_log(L_DEBUG, "Setting view to %d x %d @ %d, %d", width, height, container->x, container->y); struct wlc_geometry geometry = { .origin = { .x = container->x,