[gtk+/touchscreens: 21/69] gtk: Handle press-and-hold for touch devices



commit a308c351121a1427905a7193e17b6a9e0db91a13
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 c233e81..55f1bd4 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -6011,7 +6011,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]