diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2016-07-23 11:03:21 -0400 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2016-07-23 11:03:21 -0400 |
| commit | 105a630a87342d7932b10ad6f1aa34b749b99440 (patch) | |
| tree | 244e42bdff3616734f34a9ab4314eb272f12dd78 | |
| parent | ef6bbcb15850ed48e738a167655a11baffc742d1 (diff) | |
| parent | 00c6160c1c977673ee965dce153b7f19efb5e2df (diff) | |
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.c | 14 |
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 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; |
