From 26c6f228fee7d0a617ce8cd62e7df232602e6843 Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Tue, 28 Nov 2023 20:29:19 -0500 Subject: [PATCH] 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. --- input/input.c | 1 + 1 file changed, 1 insertion(+) 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); }