From: Matthias Clasen Date: Thu, 6 Apr 2023 19:31:03 +0000 (-0400) Subject: gestureclick: Don't use threshold for touch X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~4^2~10^2~35 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8415c5f37593af9b36ef4ba3c978e1d699dd8459;p=gtk4.git gestureclick: Don't use threshold for touch When determining double-clicks, don't use the distance threshold for touch events. It is very hard to double touch reliably within a few pixels of the same position. Fixes: #5580 --- diff --git a/gtk/gtkgestureclick.c b/gtk/gtkgestureclick.c index cc5fec25af..0b07b992ac 100644 --- a/gtk/gtkgestureclick.c +++ b/gtk/gtkgestureclick.c @@ -220,7 +220,8 @@ gtk_gesture_click_begin (GtkGesture *gesture, _gtk_gesture_click_update_timeout (click); gtk_gesture_get_point (gesture, current, &x, &y); - if (!_gtk_gesture_click_check_within_threshold (click, x, y)) + if (gdk_device_get_source (priv->current_device) == GDK_SOURCE_MOUSE && + !_gtk_gesture_click_check_within_threshold (click, x, y)) _gtk_gesture_click_stop (click); /* Increment later the real counter, just if the gesture is @@ -243,14 +244,17 @@ gtk_gesture_click_update (GtkGesture *gesture, GdkEventSequence *sequence) { GtkGestureClick *click; + GtkGestureClickPrivate *priv; GdkEventSequence *current; double x, y; click = GTK_GESTURE_CLICK (gesture); + priv = gtk_gesture_click_get_instance_private (click); current = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture)); gtk_gesture_get_point (gesture, current, &x, &y); - if (!_gtk_gesture_click_check_within_threshold (click, x, y)) + if (gdk_device_get_source (priv->current_device) == GDK_SOURCE_MOUSE && + !_gtk_gesture_click_check_within_threshold (click, x, y)) _gtk_gesture_click_stop (click); }