summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authornanahi <130121847+na-na-hi@users.noreply.github.com>2023-11-28 20:29:19 -0500
committersfan5 <sfan5@live.de>2023-12-03 22:23:05 +0100
commit26c6f228fee7d0a617ce8cd62e7df232602e6843 (patch)
tree053a08565b36d5df9499445f5e1a02a389a7f7ab /input
parentf551a9da3471fcb2568e9c4d031e2ffb867e35a8 (diff)
downloadmpv-26c6f228fee7d0a617ce8cd62e7df232602e6843.tar.bz2
mpv-26c6f228fee7d0a617ce8cd62e7df232602e6843.tar.xz
input: fix double click handling
On practically all platforms and GUI toolkits, a triggered double click event clears the mouse input buffer so that the next click won't trigger another double click event. mpv doesn't do this, so a third click results in another double click event. Fix this by resetting the double click timer after a double click event is triggered which achieves the same effect.
Diffstat (limited to 'input')
-rw-r--r--input/input.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/input/input.c b/input/input.c
index b8d12aae13..5e35987446 100644
--- a/input/input.c
+++ b/input/input.c
@@ -740,6 +740,7 @@ static void mp_input_feed_key(struct input_ctx *ictx, int code, double scale,
now - ictx->last_doubleclick_time < opts->doubleclick_time / 1000.0)
{
if (code >= MP_MBTN_LEFT && code <= MP_MBTN_RIGHT) {
+ now = 0;
interpret_key(ictx, code - MP_MBTN_BASE + MP_MBTN_DBL_BASE,
1, 1);
}