[gtk+] GtkWidget: Fix motion event consumption detection for touch-only gestures



commit 0167f7c65c95b3bcf2d4800c1eceaf8f916ea303
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Jan 11 20:06:14 2016 +0100

    GtkWidget: Fix motion event consumption detection for touch-only gestures
    
    If a GtkGestureSingle is set as touch-only, pointer events would be
    discarded without giving an opportunity to the regular GtkGesture
    handler to manage those.
    
    Because the pointer events weren't actually managed by the gesture,
    gtk_gesture_get_sequence_state() (rather unhelpfully here) will resort
    to returning GTK_EVENT_SEQUENCE_NONE, which is in turn interpreted
    by _gtk_widget_consumes_motion() as "may be handling the events for
    this sequence", because gestures in this state presumably handle
    the events, just that it's not "claimed" yet.
    
    Instead, use gtk_gesture_handles_sequence(), which will perform the
    expected check on the event sequence being managed, as we expect
    here.

 gtk/gtkwidget.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 8094524..7ce8f83 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -17593,8 +17593,7 @@ _gtk_widget_consumes_motion (GtkWidget        *widget,
       if ((!GTK_IS_GESTURE_SINGLE (data->controller) ||
            GTK_IS_GESTURE_DRAG (data->controller) ||
            GTK_IS_GESTURE_SWIPE (data->controller)) &&
-          gtk_gesture_get_sequence_state (GTK_GESTURE (data->controller),
-                                          sequence) != GTK_EVENT_SEQUENCE_DENIED)
+          gtk_gesture_handles_sequence (GTK_GESTURE (data->controller), sequence))
         return TRUE;
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]