[gtk+/xi2-playground: 4/8] GdkWindow: Make gdk_window_set_support_multidevice() enable touchpoints.



commit 0ac8f1686fb40c1fb6ad620cd8009da5aaafc227
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jun 4 14:37:15 2010 +0200

    GdkWindow: Make gdk_window_set_support_multidevice() enable touchpoints.

 gdk/gdkwindow.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index e7cbeec..fdd5734 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -10080,6 +10080,7 @@ gdk_window_set_support_multidevice (GdkWindow *window,
                                     gboolean   support_multidevice)
 {
   GdkWindowObject *private = (GdkWindowObject *) window;
+  GdkEventMask event_mask = 0;
 
   g_return_if_fail (GDK_IS_WINDOW (window));
 
@@ -10091,6 +10092,12 @@ gdk_window_set_support_multidevice (GdkWindow *window,
 
   private->support_multidevice = support_multidevice;
 
+  if (support_multidevice)
+    event_mask = gdk_window_get_events (window);
+
+  /* Enable events for slave touchscreen devices */
+  gdk_window_set_source_events (window, GDK_SOURCE_TOUCH, event_mask);
+
   /* FIXME: What to do if called when some pointers are inside the window ? */
 }
 



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