[gtk+/multitouch: 21/121] gtk: Handle press-and-hold for touch devices



commit 4a65a53077bfb197db6de968b007500802e280f0
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 c46bb53..03454c5 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -6013,7 +6013,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]