aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2015-08-09 20:58:03 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2015-08-09 20:58:03 -0400
commitc12d0f1a6273916632c1085970b86c929bd62491 (patch)
tree7432aea7670bd491e26fff0fcd55c6431890b350
parentFlesh out fullscreen support a bit (diff)
downloadsway-c12d0f1a6273916632c1085970b86c929bd62491.tar.gz
sway-c12d0f1a6273916632c1085970b86c929bd62491.tar.zst
sway-c12d0f1a6273916632c1085970b86c929bd62491.zip
Finish up fullscreen command
-rw-r--r--sway/layout.c52
1 files changed, 28 insertions, 24 deletions
diff --git a/sway/layout.c b/sway/layout.c
index faf25c8c..e9fa2a7a 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -41,31 +41,35 @@ void arrange_windows(swayc_t *container, int width, int height) {
41 } 41 }
42 return; 42 return;
43 case C_VIEW: 43 case C_VIEW:
44 sway_log(L_DEBUG, "Setting view to %d x %d @ %d, %d", width, height, container->x, container->y); 44 {
45 struct wlc_geometry geometry = { 45 struct wlc_geometry geometry = {
46 .origin = { 46 .origin = {
47 .x = container->x, 47 .x = container->x,
48 .y = container->y 48 .y = container->y
49 }, 49 },
50 .size = { 50 .size = {
51 .w = width, 51 .w = width,
52 .h = height 52 .h = height
53 }
54 };
55 if (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN) {
56 swayc_t *parent = container;
57 while(parent->type != C_OUTPUT) {
58 parent = parent->parent;
59 }
60 geometry.origin.x = 0;
61 geometry.origin.y = 0;
62 geometry.size.w = parent->width;
63 geometry.size.h = parent->height;
64 wlc_view_set_geometry(container->handle, &geometry);
65 wlc_view_bring_to_front(container->handle);
66 } else {
67 wlc_view_set_geometry(container->handle, &geometry);
68 container->width = width;
69 container->height = height;
53 } 70 }
54 }; 71 sway_log(L_DEBUG, "Set view to %d x %d @ %d, %d", geometry.size.w, geometry.size.h,
55 if (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN) { 72 geometry.origin.x, geometry.origin.y);
56 swayc_t *parent = container;
57 while(parent->type != C_OUTPUT) {
58 parent = parent->parent;
59 }
60 geometry.origin.x = 0;
61 geometry.origin.y = 0;
62 geometry.size.w = parent->width;
63 geometry.size.h = parent->height;
64 wlc_view_set_geometry(container->handle, &geometry);
65 } else {
66 wlc_view_set_geometry(container->handle, &geometry);
67 container->width = width;
68 container->height = height;
69 } 73 }
70 return; 74 return;
71 default: 75 default: