diff options
Diffstat (limited to 'sway/handlers.c')
-rw-r--r-- | sway/handlers.c | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index 23c9985e..67275575 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -723,36 +723,11 @@ static bool handle_pointer_button(wlc_handle view, uint32_t time, const struct w | |||
723 | bool handle_pointer_scroll(wlc_handle view, uint32_t time, const struct wlc_modifiers* modifiers, | 723 | bool handle_pointer_scroll(wlc_handle view, uint32_t time, const struct wlc_modifiers* modifiers, |
724 | uint8_t axis_bits, double _amount[2]) { | 724 | uint8_t axis_bits, double _amount[2]) { |
725 | if (!(modifiers->mods ^ config->floating_mod)) { | 725 | if (!(modifiers->mods ^ config->floating_mod)) { |
726 | switch (config->floating_scroll) { | 726 | int amount = (int)_amount[0]; |
727 | case FSB_GAPS_INNER: | 727 | if (amount > 0) { |
728 | case FSB_GAPS_OUTER: | 728 | handle_command(config->floating_scroll_up_cmd); |
729 | { | 729 | } else if (amount < 0) { |
730 | int amount = (int)_amount[0]; | 730 | handle_command(config->floating_scroll_down_cmd); |
731 | int i,j; | ||
732 | for (i = 0; i < root_container.children->length; ++i) { | ||
733 | swayc_t *op = root_container.children->items[i]; | ||
734 | for (j = 0; j < op->children->length; ++j) { | ||
735 | swayc_t *ws = op->children->items[j]; | ||
736 | if (config->floating_scroll == FSB_GAPS_INNER) { | ||
737 | container_map(ws, add_gaps, &amount); | ||
738 | } else { | ||
739 | ws->gaps += amount; | ||
740 | } | ||
741 | } | ||
742 | } | ||
743 | arrange_windows(&root_container, -1, -1); | ||
744 | break; | ||
745 | } | ||
746 | case FSB_CUSTOM: | ||
747 | { | ||
748 | int amount = (int)_amount[0]; | ||
749 | if (amount > 0) { | ||
750 | handle_command(config->fsb_up); | ||
751 | } else if (amount < 0) { | ||
752 | handle_command(config->fsb_down); | ||
753 | } | ||
754 | break; | ||
755 | } | ||
756 | } | 731 | } |
757 | } | 732 | } |
758 | return EVENT_PASSTHROUGH; | 733 | return EVENT_PASSTHROUGH; |