[gtk+/touch-selection-improvements: 2/9] gesturesingle: check for the sequence being handled, not just the event



commit 75ab6ecd0e002593de1c98c1ea7eb060b9fb6427
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Nov 20 13:25:40 2014 +0100

    gesturesingle: check for the sequence being handled, not just the event
    
    Checking the return value was valid for most gestures, but
    GtkGestureLongPress, where the first press triggers internally an action,
    but does nothing for the sequence to be claimed/denied, FALSE was eventually
    returned, and the button/sequence functions would be incorrect when
    ::pressed is emitted.
    
    So check that the sequence is being handled by the gesture, this is more
    desirable than the return value as it's independent of sequence state,
    and still will be FALSE for the cases we want to catch here.

 gtk/gtkgesturesingle.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkgesturesingle.c b/gtk/gtkgesturesingle.c
index c549e6d..458bffe 100644
--- a/gtk/gtkgesturesingle.c
+++ b/gtk/gtkgesturesingle.c
@@ -220,7 +220,8 @@ gtk_gesture_single_handle_event (GtkEventController *controller,
   if (sequence == priv->current_sequence &&
       (event->type == GDK_BUTTON_RELEASE || event->type == GDK_TOUCH_END))
     priv->current_button = 0;
-  else if (!retval)
+  else if (priv->current_sequence == sequence &&
+           !gtk_gesture_handles_sequence (GTK_GESTURE (controller), sequence))
     {
       if (button == priv->current_button && event->type == GDK_BUTTON_PRESS)
         priv->current_button = 0;


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