summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sway/container.c11
-rw-r--r--sway/layout.c4
2 files changed, 12 insertions, 3 deletions
diff --git a/sway/container.c b/sway/container.c
index b85d2114..e6fa4f37 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -671,7 +671,16 @@ int swayc_gap(swayc_t *container) {
671 if (container->type == C_VIEW) { 671 if (container->type == C_VIEW) {
672 return container->gaps >= 0 ? container->gaps : config->gaps_inner; 672 return container->gaps >= 0 ? container->gaps : config->gaps_inner;
673 } else if (container->type == C_WORKSPACE) { 673 } else if (container->type == C_WORKSPACE) {
674 return container->gaps >= 0 ? container->gaps : config->gaps_outer; 674 int base = container->gaps >= 0 ? container->gaps : config->gaps_outer;
675 if (config->edge_gaps) {
676 // the inner gap is created via a margin around each window which
677 // is half the gap size, so the workspace also needs half a gap
678 // size to make the outermost gap the same size (excluding the
679 // actual "outer gap" size which is handled independently)
680 return base + config->gaps_inner / 2;
681 } else {
682 return base;
683 }
675 } else { 684 } else {
676 return 0; 685 return 0;
677 } 686 }
diff --git a/sway/layout.c b/sway/layout.c
index 6d82921c..a9e7c7f1 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -398,10 +398,10 @@ void update_geometry(swayc_t *container) {
398 geometry.size.h = container->height - gap/2; 398 geometry.size.h = container->height - gap/2;
399 } 399 }
400 if (container->x + container->width + gap >= ws->x + ws->width) { 400 if (container->x + container->width + gap >= ws->x + ws->width) {
401 geometry.size.w = ws->width - geometry.origin.x; 401 geometry.size.w = ws->x + ws->width - geometry.origin.x;
402 } 402 }
403 if (container->y + container->height + gap >= ws->y + ws->height) { 403 if (container->y + container->height + gap >= ws->y + ws->height) {
404 geometry.size.h = ws->height - geometry.origin.y; 404 geometry.size.h = ws->y + ws->height - geometry.origin.y;
405 } 405 }
406 } 406 }
407 wlc_view_set_geometry(container->handle, 0, &geometry); 407 wlc_view_set_geometry(container->handle, 0, &geometry);