diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2017-08-25 16:47:11 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2017-09-19 18:39:02 +0200 |
commit | 7545b908dede007c663eefbd52cdbc7131bf7628 (patch) | |
tree | 1baa52a585b91f728a1085f82588a911b43655fc /gtk/gtkgesturelongpress.c | |
parent | 67239f112e95ea238ce172ac3a71ec7425a0b28f (diff) | |
download | gtk+-7545b908dede007c663eefbd52cdbc7131bf7628.tar.gz |
gesture: Update to using GdkEvent API
To some extent, pad and touchpad gesture events need extra API.
Diffstat (limited to 'gtk/gtkgesturelongpress.c')
-rw-r--r-- | gtk/gtkgesturelongpress.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gtk/gtkgesturelongpress.c b/gtk/gtkgesturelongpress.c index de4ff7994f..dfdaca0001 100644 --- a/gtk/gtkgesturelongpress.c +++ b/gtk/gtkgesturelongpress.c @@ -116,6 +116,7 @@ gtk_gesture_long_press_begin (GtkGesture *gesture, { GtkGestureLongPressPrivate *priv; const GdkEvent *event; + GdkEventType event_type; GtkWidget *widget; gint delay; @@ -123,9 +124,13 @@ gtk_gesture_long_press_begin (GtkGesture *gesture, sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture)); event = gtk_gesture_get_last_event (gesture, sequence); - if (!event || - (event->type != GDK_BUTTON_PRESS && - event->type != GDK_TOUCH_BEGIN)) + if (!event) + return; + + event_type = gdk_event_get_event_type (event); + + if (event_type != GDK_BUTTON_PRESS && + event_type != GDK_TOUCH_BEGIN) return; widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture)); |