diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c index 32756afccc..705a4ba593 100644 --- a/gtk/gtkgesture.c +++ b/gtk/gtkgesture.c @@ -162,7 +162,6 @@ struct _GtkGesturePrivate GdkDevice *device; GList *group_link; guint n_points; - guint hold_timeout_id; guint recognized : 1; guint touchpad : 1; }; @@ -175,8 +174,6 @@ static guint signals[N_SIGNALS] = { 0 }; gdk_event_get_event_type (e) == GDK_TOUCHPAD_PINCH || \ gdk_event_get_event_type (e) == GDK_TOUCHPAD_HOLD) -#define HOLD_TIMEOUT_MS 50 - GList * _gtk_gesture_get_group_link (GtkGesture *gesture); G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GtkGesture, gtk_gesture, GTK_TYPE_EVENT_CONTROLLER) @@ -225,7 +222,6 @@ gtk_gesture_finalize (GObject *object) gtk_gesture_ungroup (gesture); g_list_free (priv->group_link); - g_clear_handle_id (&priv->hold_timeout_id, g_source_remove); g_hash_table_destroy (priv->points); @@ -583,22 +579,6 @@ _gtk_gesture_cancel_all (GtkGesture *gesture) _gtk_gesture_check_empty (gesture); } -static gboolean -gtk_gesture_hold_timeout (gpointer user_data) -{ - GtkGesture *gesture; - GtkGesturePrivate *priv; - - gesture = user_data; - priv = gtk_gesture_get_instance_private (gesture); - - if (priv->touchpad) - _gtk_gesture_cancel_sequence (gesture, priv->last_sequence); - - priv->hold_timeout_id = 0; - return G_SOURCE_REMOVE; -} - static gboolean gesture_within_surface (GtkGesture *gesture, GdkSurface *surface) @@ -664,10 +644,6 @@ gtk_gesture_handle_event (GtkEventController *controller, (event_type == GDK_TOUCHPAD_PINCH && phase == GDK_TOUCHPAD_GESTURE_PHASE_BEGIN) || (event_type == GDK_TOUCHPAD_HOLD && phase == GDK_TOUCHPAD_GESTURE_PHASE_BEGIN)) { - if ((event_type == GDK_TOUCHPAD_PINCH || event_type == GDK_TOUCHPAD_SWIPE) && - _gtk_gesture_has_matching_touchpoints (gesture)) - g_clear_handle_id (&priv->hold_timeout_id, g_source_remove); - if (_gtk_gesture_update_point (gesture, event, target, x, y, TRUE)) { gboolean triggered_recognition; @@ -738,20 +714,12 @@ gtk_gesture_handle_event (GtkEventController *controller, _gtk_gesture_cancel_sequence (gesture, sequence); } else if ((event_type == GDK_TOUCHPAD_SWIPE && phase == GDK_TOUCHPAD_GESTURE_PHASE_CANCEL) || - (event_type == GDK_TOUCHPAD_PINCH && phase == GDK_TOUCHPAD_GESTURE_PHASE_CANCEL)) + (event_type == GDK_TOUCHPAD_PINCH && phase == GDK_TOUCHPAD_GESTURE_PHASE_CANCEL) || + (event_type == GDK_TOUCHPAD_HOLD && phase == GDK_TOUCHPAD_GESTURE_PHASE_CANCEL)) { if (priv->touchpad) _gtk_gesture_cancel_sequence (gesture, sequence); } - else if (event_type == GDK_TOUCHPAD_HOLD && phase == GDK_TOUCHPAD_GESTURE_PHASE_CANCEL) - { - if (priv->hold_timeout_id == 0) - { - priv->hold_timeout_id = g_timeout_add (HOLD_TIMEOUT_MS, - gtk_gesture_hold_timeout, - gesture); - } - } else if (event_type == GDK_GRAB_BROKEN) { GdkSurface *surface; @@ -777,10 +745,6 @@ gtk_gesture_handle_event (GtkEventController *controller, static void gtk_gesture_reset (GtkEventController *controller) { - GtkGesture *gesture = GTK_GESTURE (controller); - GtkGesturePrivate *priv = gtk_gesture_get_instance_private (gesture); - - g_clear_handle_id (&priv->hold_timeout_id, g_source_remove); _gtk_gesture_cancel_all (GTK_GESTURE (controller)); } @@ -949,7 +913,6 @@ gtk_gesture_init (GtkGesture *gesture) priv->points = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) free_point_data); priv->group_link = g_list_prepend (NULL, gesture); - priv->hold_timeout_id = 0; } /**