[gtk+] gtkwidget: Drop pointer emulation out of touch events



commit 5b9287ed77d151320239f7951ec94d5e97615004
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon May 29 12:02:53 2017 +0200

    gtkwidget: Drop pointer emulation out of touch events
    
    Users of touch events are required to either use a GtkGesture, or handle
    touch events themselves.

 gtk/gtkwidget.c |   64 +------------------------------------------------------
 1 files changed, 1 insertions(+), 63 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 8e369e0..4a83376 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -6515,69 +6515,7 @@ static gboolean
 gtk_widget_real_touch_event (GtkWidget     *widget,
                              GdkEventTouch *event)
 {
-  GdkEvent *bevent;
-  gboolean return_val;
-  gint signum;
-
-  if (event->type == GDK_TOUCH_BEGIN ||
-      event->type == GDK_TOUCH_END)
-    {
-      GdkEventType type;
-
-      if (event->type == GDK_TOUCH_BEGIN)
-        {
-          type = GDK_BUTTON_PRESS;
-          signum = BUTTON_PRESS_EVENT;
-        }
-      else
-        {
-          type = GDK_BUTTON_RELEASE;
-          signum = BUTTON_RELEASE_EVENT;
-        }
-      bevent = gdk_event_new (type);
-      bevent->any.window = g_object_ref (event->window);
-      bevent->any.send_event = FALSE;
-      bevent->button.time = event->time;
-      bevent->button.state = event->state;
-      bevent->button.button = 1;
-      bevent->button.x_root = event->x_root;
-      bevent->button.y_root = event->y_root;
-      bevent->button.x = event->x;
-      bevent->button.y = event->y;
-      bevent->button.device = event->device;
-      bevent->button.axes = g_memdup (event->axes,
-                                      sizeof (gdouble) * gdk_device_get_n_axes (event->device));
-      gdk_event_set_source_device (bevent, gdk_event_get_source_device ((GdkEvent*)event));
-
-      if (event->type == GDK_TOUCH_END)
-        bevent->button.state |= GDK_BUTTON1_MASK;
-    }
-  else if (event->type == GDK_TOUCH_UPDATE)
-    {
-      signum = MOTION_NOTIFY_EVENT;
-      bevent = gdk_event_new (GDK_MOTION_NOTIFY);
-      bevent->any.window = g_object_ref (event->window);
-      bevent->any.send_event = FALSE;
-      bevent->motion.time = event->time;
-      bevent->motion.state = event->state | GDK_BUTTON1_MASK;
-      bevent->motion.x_root = event->x_root;
-      bevent->motion.y_root = event->y_root;
-      bevent->motion.x = event->x;
-      bevent->motion.y = event->y;
-      bevent->motion.device = event->device;
-      bevent->motion.is_hint = FALSE;
-      bevent->motion.axes = g_memdup (event->axes,
-                                      sizeof (gdouble) * gdk_device_get_n_axes (event->device));
-      gdk_event_set_source_device (bevent, gdk_event_get_source_device ((GdkEvent*)event));
-    }
-  else
-    return FALSE;
-
-  g_signal_emit (widget, widget_signals[signum], 0, bevent, &return_val);
-
-  gdk_event_free (bevent);
-
-  return return_val;
+  return GDK_EVENT_PROPAGATE;
 }
 
 static gboolean


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