diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-11-25 19:31:13 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-12-01 19:33:52 +0100 |
commit | 022735fa72f07facdaa2c7a79f0d3af21a28f266 (patch) | |
tree | 76291c156ab944d0597515fb1dcfbbc2ea91cb30 | |
parent | 600193749d0edef7532a6ad0312b3b78bd468b1d (diff) | |
download | mpv-022735fa72f07facdaa2c7a79f0d3af21a28f266.tar.bz2 mpv-022735fa72f07facdaa2c7a79f0d3af21a28f266.tar.xz |
input: discard precise scrolling commands with no value
Apparently Cocoa precise scrolling generates a lot of spurious events with
a delta that is equal to 0.0. Make sure that they are discarded and not added
to the input queue.
Even though this only known to happen with Cocoa, I implemented this at core
level since it makes sense in general.
Fixes: #310
-rw-r--r-- | mpvcore/input/input.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mpvcore/input/input.c b/mpvcore/input/input.c index b26f2d491d..5a8dee1fd5 100644 --- a/mpvcore/input/input.c +++ b/mpvcore/input/input.c @@ -1639,6 +1639,8 @@ void mp_input_put_key_utf8(struct input_ctx *ictx, int mods, struct bstr t) void mp_input_put_axis(struct input_ctx *ictx, int direction, double value) { + if (value == 0.0) + return; input_lock(ictx); mp_input_feed_key(ictx, direction, value); input_unlock(ictx); |