mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 05:31:07 +00:00
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
This commit is contained in:
parent
99251c0c8f
commit
c0fa9e80aa
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user