summaryrefslogtreecommitdiffstats
path: root/sway/handlers.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/handlers.c')
-rw-r--r--sway/handlers.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index 54326dd0..9648e729 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -647,6 +647,31 @@ static bool handle_pointer_button(wlc_handle view, uint32_t time, const struct w
647 case M_SCROLL_DOWN: 647 case M_SCROLL_DOWN:
648 break; 648 break;
649 } 649 }
650 if (!(modifiers->mods ^ config->floating_mod) &&
651 (button == M_SCROLL_UP || button == M_SCROLL_DOWN)) {
652 switch (config->floating_scroll) {
653 case FSB_GAPS_INNER:
654 case FSB_GAPS_OUTER:
655 {
656 int amount = button == M_SCROLL_UP ? -1 : 1;
657 int i,j;
658 for (i = 0; i < root_container.children->length; ++i) {
659 swayc_t *op = root_container.children->items[i];
660 for (j = 0; j < op->children->length; ++j) {
661 swayc_t *ws = op->children->items[j];
662 // TODO: adjust outer gaps ws->gaps = 0;
663 if (config->floating_scroll == FSB_GAPS_INNER) {
664 container_map(ws, add_gaps, &amount);
665 } else {
666 ws->gaps += amount;
667 }
668 }
669 }
670 arrange_windows(&root_container, -1, -1);
671 break;
672 }
673 }
674 }
650 675
651 // get focused window and check if to change focus on mouse click 676 // get focused window and check if to change focus on mouse click
652 swayc_t *focused = get_focused_container(&root_container); 677 swayc_t *focused = get_focused_container(&root_container);