diff options
Diffstat (limited to 'sway/layout.c')
-rw-r--r-- | sway/layout.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sway/layout.c b/sway/layout.c index c6a05107..3bc297a6 100644 --- a/sway/layout.c +++ b/sway/layout.c | |||
@@ -367,9 +367,27 @@ void update_geometry(swayc_t *container) { | |||
367 | if (op->focused == ws) { | 367 | if (op->focused == ws) { |
368 | wlc_view_bring_to_front(container->handle); | 368 | wlc_view_bring_to_front(container->handle); |
369 | } | 369 | } |
370 | } else if (!config->edge_gaps && gap > 0) { | ||
371 | // Remove gap against the workspace edges. Because a pixel is not | ||
372 | // divisable, depending on gap size and the number of siblings our view | ||
373 | // might be at the workspace edge without being exactly so (thus test | ||
374 | // with gap, and align correctly). | ||
375 | if (container->x - gap <= ws->x) { | ||
376 | geometry.origin.x = ws->x; | ||
377 | geometry.size.w = container->width - gap/2; | ||
378 | } | ||
379 | if (container->y - gap <= ws->y) { | ||
380 | geometry.origin.y = ws->y; | ||
381 | geometry.size.h = container->height - gap/2; | ||
382 | } | ||
383 | if (container->x + container->width + gap >= ws->x + ws->width) { | ||
384 | geometry.size.w = ws->width - geometry.origin.x; | ||
385 | } | ||
386 | if (container->y + container->height + gap >= ws->y + ws->height) { | ||
387 | geometry.size.h = ws->height - geometry.origin.y; | ||
388 | } | ||
370 | } | 389 | } |
371 | wlc_view_set_geometry(container->handle, 0, &geometry); | 390 | wlc_view_set_geometry(container->handle, 0, &geometry); |
372 | return; | ||
373 | } | 391 | } |
374 | 392 | ||
375 | static void arrange_windows_r(swayc_t *container, double width, double height) { | 393 | static void arrange_windows_r(swayc_t *container, double width, double height) { |