aboutsummaryrefslogtreecommitdiff
path: root/sway/layout.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-08-09 20:49:19 -0400
committerDrew DeVault <sir@cmpwn.com>2015-08-09 20:49:58 -0400
commit0078a6fa36d65704c55d426d022768e15b33a240 (patch)
tree666a30b5720eb704306d55daa5bfeb1be39f85ec /sway/layout.c
parentb922e1cb29198c841d81090542d309e2be6f8ba9 (diff)
Flesh out fullscreen support a bit
Diffstat (limited to 'sway/layout.c')
-rw-r--r--sway/layout.c41
1 files changed, 15 insertions, 26 deletions
diff --git a/sway/layout.c b/sway/layout.c
index affcb83e..faf25c8c 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -41,29 +41,6 @@ void arrange_windows(swayc_t *container, int width, int height) {
}
return;
case C_VIEW:
- // 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) {
- 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 = {
@@ -75,9 +52,21 @@ void arrange_windows(swayc_t *container, int width, int height) {
.h = height
}
};
- wlc_view_set_geometry(container->handle, &geometry);
- container->width = width;
- container->height = height;
+ if (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN) {
+ swayc_t *parent = container;
+ while(parent->type != C_OUTPUT) {
+ parent = parent->parent;
+ }
+ geometry.origin.x = 0;
+ geometry.origin.y = 0;
+ geometry.size.w = parent->width;
+ geometry.size.h = parent->height;
+ wlc_view_set_geometry(container->handle, &geometry);
+ } else {
+ wlc_view_set_geometry(container->handle, &geometry);
+ container->width = width;
+ container->height = height;
+ }
return;
default:
container->width = width;