[gtk+/multitouch: 42/57] gtk: Handle press-and-hold for touch devices



commit b7a097cfca45b84300e094b80e5d2e8ed71d7ced
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Nov 1 12:36:18 2011 +0100

    gtk: Handle press-and-hold for touch devices
    
    Also, only react to the first button

 gtk/gtkwidget.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index bab2e2e..d2041ed 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -6025,7 +6025,9 @@ _gtk_widget_captured_event (GtkWidget *widget,
 
   g_object_ref (widget);
 
-  if (event->type == GDK_BUTTON_PRESS)
+  if ((event->type == GDK_BUTTON_PRESS ||
+       event->type == GDK_TOUCH_PRESS) &&
+      event->button.button == 1)
     {
       /* Handle press and hold */
       gtk_widget_press_and_hold_start (widget,



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