commit 80858c1f5784c65548c96b8f4d4bd02e90f7dd88
parent 643bd8f15816d0443f3e8d2a32ef6b20547cd389
Author: D.B <thejan.2009@gmail.com>
Date: Sat, 23 Jul 2016 16:30:04 +0200
don't passthrough a floating_scroll event to focused window
Diffstat:
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git 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
if (!(modifiers->mods ^ config->floating_mod)) {
int x_amount = (int)_amount[0];
int y_amount = (int)_amount[1];
- if (x_amount > 0) {
+
+ if (x_amount > 0 && strcmp(config->floating_scroll_up_cmd, "")) {
handle_command(config->floating_scroll_up_cmd);
- } else if (x_amount < 0) {
+ return EVENT_HANDLED;
+ } else if (x_amount < 0 && strcmp(config->floating_scroll_down_cmd, "")) {
handle_command(config->floating_scroll_down_cmd);
+ return EVENT_HANDLED;
}
- if (y_amount > 0) {
+
+ if (y_amount > 0 && strcmp(config->floating_scroll_right_cmd, "")) {
handle_command(config->floating_scroll_right_cmd);
- } else if (y_amount < 0) {
+ return EVENT_HANDLED;
+ } else if (y_amount < 0 && strcmp(config->floating_scroll_left_cmd, "")) {
handle_command(config->floating_scroll_left_cmd);
+ return EVENT_HANDLED;
}
}
return EVENT_PASSTHROUGH;