diff options
Diffstat (limited to 'sway/container.c')
-rw-r--r-- | sway/container.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/sway/container.c b/sway/container.c index c922a6e6..ef0e6c55 100644 --- a/sway/container.c +++ b/sway/container.c | |||
@@ -653,15 +653,24 @@ void update_visibility(swayc_t *container) { | |||
653 | } | 653 | } |
654 | } | 654 | } |
655 | 655 | ||
656 | void reset_gaps(swayc_t *view, void *data) { | 656 | void set_gaps(swayc_t *view, void *_data) { |
657 | (void) data; | 657 | int *data = _data; |
658 | if (!ASSERT_NONNULL(view)) { | 658 | if (!ASSERT_NONNULL(view)) { |
659 | return; | 659 | return; |
660 | } | 660 | } |
661 | if (view->type == C_WORKSPACE) { | 661 | if (view->type == C_WORKSPACE || view->type == C_VIEW) { |
662 | view->gaps = -1; | 662 | view->gaps = *data; |
663 | } | 663 | } |
664 | if (view->type == C_VIEW) { | 664 | } |
665 | view->gaps = -1; | 665 | |
666 | void add_gaps(swayc_t *view, void *_data) { | ||
667 | int *data = _data; | ||
668 | if (!ASSERT_NONNULL(view)) { | ||
669 | return; | ||
670 | } | ||
671 | if (view->type == C_WORKSPACE || view->type == C_VIEW) { | ||
672 | if ((view->gaps += *data) < 0) { | ||
673 | view->gaps = 0; | ||
674 | } | ||
666 | } | 675 | } |
667 | } | 676 | } |