summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2016-07-23 11:03:21 -0400
committerLibravatar GitHub <noreply@github.com>2016-07-23 11:03:21 -0400
commit4637462a6860cebcbf0ff196f84363a452db651d (patch)
tree244e42bdff3616734f34a9ab4314eb272f12dd78
parentMerge pull request #779 from thejan2009/smart-gaps-outer (diff)
parentdon't passthrough a floating_scroll event to focused window (diff)
downloadsway-4637462a6860cebcbf0ff196f84363a452db651d.tar.gz
sway-4637462a6860cebcbf0ff196f84363a452db651d.tar.zst
sway-4637462a6860cebcbf0ff196f84363a452db651d.zip
Merge pull request #785 from thejan2009/floating-scroll-event-passthrough
don't passthrough a floating_scroll event to focused window
-rw-r--r--sway/handlers.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index abed8cd7..05da5700 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -876,15 +876,21 @@ bool handle_pointer_scroll(wlc_handle view, uint32_t time, const struct wlc_modi
876 if (!(modifiers->mods ^ config->floating_mod)) { 876 if (!(modifiers->mods ^ config->floating_mod)) {
877 int x_amount = (int)_amount[0]; 877 int x_amount = (int)_amount[0];
878 int y_amount = (int)_amount[1]; 878 int y_amount = (int)_amount[1];
879 if (x_amount > 0) { 879
880 if (x_amount > 0 && strcmp(config->floating_scroll_up_cmd, "")) {
880 handle_command(config->floating_scroll_up_cmd); 881 handle_command(config->floating_scroll_up_cmd);
881 } else if (x_amount < 0) { 882 return EVENT_HANDLED;
883 } else if (x_amount < 0 && strcmp(config->floating_scroll_down_cmd, "")) {
882 handle_command(config->floating_scroll_down_cmd); 884 handle_command(config->floating_scroll_down_cmd);
885 return EVENT_HANDLED;
883 } 886 }
884 if (y_amount > 0) { 887
888 if (y_amount > 0 && strcmp(config->floating_scroll_right_cmd, "")) {
885 handle_command(config->floating_scroll_right_cmd); 889 handle_command(config->floating_scroll_right_cmd);
886 } else if (y_amount < 0) { 890 return EVENT_HANDLED;
891 } else if (y_amount < 0 && strcmp(config->floating_scroll_left_cmd, "")) {
887 handle_command(config->floating_scroll_left_cmd); 892 handle_command(config->floating_scroll_left_cmd);
893 return EVENT_HANDLED;
888 } 894 }
889 } 895 }
890 return EVENT_PASSTHROUGH; 896 return EVENT_PASSTHROUGH;