gtkgestureswipe: Don't filter hold events

Part-of: <!3454>
This commit is contained in:
José Expósito 2021-06-28 17:51:17 +02:00 committed by Carlos Garnacho
parent 34133ec1e8
commit fe86aa5f6b
2 changed files with 7 additions and 2 deletions

View File

@ -197,6 +197,10 @@ gtk_gesture_single_handle_event (GtkEventController *controller,
}
break;
case GDK_TOUCHPAD_HOLD:
if (gdk_touchpad_event_get_n_fingers (event) == 1)
return FALSE;
/* fallthrough */
case GDK_TOUCH_CANCEL:
case GDK_GRAB_BROKEN:
case GDK_TOUCHPAD_SWIPE:

View File

@ -84,8 +84,9 @@ static gboolean
gtk_gesture_swipe_filter_event (GtkEventController *controller,
GdkEvent *event)
{
/* Let touchpad swipe events go through, only if they match n-points */
if (gdk_event_get_event_type (event) == GDK_TOUCHPAD_SWIPE)
/* Let touchpad swipe and hold events go through, only if they match n-points */
if (gdk_event_get_event_type (event) == GDK_TOUCHPAD_SWIPE ||
gdk_event_get_event_type (event) == GDK_TOUCHPAD_HOLD)
{
guint n_points;
guint n_fingers;