summaryrefslogtreecommitdiffstats
path: root/sway/container.c
diff options
context:
space:
mode:
authorLibravatar taiyu <taiyu.len@gmail.com>2015-09-05 20:48:52 -0700
committerLibravatar taiyu <taiyu.len@gmail.com>2015-09-05 20:48:52 -0700
commitf25c6b312b2f4176a1936436e23140c791919ceb (patch)
tree63537a7cb41b5e4c97cc25a243fdaf9b939fdefd /sway/container.c
parentMerge pull request #170 from mikkeloscar/master (diff)
downloadsway-f25c6b312b2f4176a1936436e23140c791919ceb.tar.gz
sway-f25c6b312b2f4176a1936436e23140c791919ceb.tar.zst
sway-f25c6b312b2f4176a1936436e23140c791919ceb.zip
gap resize
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c21
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
656void reset_gaps(swayc_t *view, void *data) { 656void 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
666void 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}