[gtk+] gtk: Be more careful when ignoring touch events



commit ea57924ddee6cda29c4d1e96c72855805dbeacdf
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Mar 4 11:20:02 2012 -0500

    gtk: Be more careful when ignoring touch events

 gtk/gtkpressandhold.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkpressandhold.c b/gtk/gtkpressandhold.c
index aed0095..cabdc34 100644
--- a/gtk/gtkpressandhold.c
+++ b/gtk/gtkpressandhold.c
@@ -187,7 +187,8 @@ gtk_press_and_hold_process_event (GtkPressAndHold *pah,
   GtkPressAndHoldPrivate *priv = pah->priv;
 
   /* We're already tracking a different touch, ignore */
-  if (priv->sequence != NULL && priv->sequence != event->touch.sequence)
+  if ((event->type == GDK_TOUCH_BEGIN && priv->sequence != NULL) ||
+      (event->type != GDK_TOUCH_BEGIN && priv->sequence != event->touch.sequence))
     return;
 
   priv->x = event->touch.x;
@@ -198,7 +199,6 @@ gtk_press_and_hold_process_event (GtkPressAndHold *pah,
       priv->sequence = event->touch.sequence;
       priv->start_x = priv->x;
       priv->start_y = priv->y;
-
       priv->timeout =
           gdk_threads_add_timeout (priv->hold_time, hold_action, pah);
     }



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