diff options
author | S. Christoffer Eliesen <christoffer@eliesen.no> | 2015-12-19 01:21:00 +0100 |
---|---|---|
committer | S. Christoffer Eliesen <christoffer@eliesen.no> | 2015-12-20 21:23:20 +0100 |
commit | ce54b4ff2eeda61ead9389a9bfd41aa7310a6ece (patch) | |
tree | 2c368a6671d0b866e498149973b9987cb9fe82ba | |
parent | Merge pull request #380 from mikkeloscar/bar-font-support (diff) | |
download | sway-ce54b4ff2eeda61ead9389a9bfd41aa7310a6ece.tar.gz sway-ce54b4ff2eeda61ead9389a9bfd41aa7310a6ece.tar.zst sway-ce54b4ff2eeda61ead9389a9bfd41aa7310a6ece.zip |
container: Fix inner gaps against screen edge.
-rw-r--r-- | sway/container.c | 11 |
1 files changed, 10 insertions, 1 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 | } |