[gtk+/multitouch: 105/124] gdk: Have touch grabs behave like the implicit grab wrt crossing events



commit 4d2fec27e5b6705d36f08dd0be1f11be5fb81354
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Jan 5 00:51:32 2012 +0100

    gdk: Have touch grabs behave like the implicit grab wrt crossing events
    
    These are equivalent to an implicit grab (with !owner_events), so
    if the touch leaves or enters the grab window, the other window
    won't receive the corresponding counter-event.

 gdk/gdkwindow.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index b02f954..15f491b 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -8429,14 +8429,28 @@ send_crossing_event (GdkDisplay                 *display,
   GdkEvent *event;
   guint32 window_event_mask, type_event_mask;
   GdkDeviceGrabInfo *grab;
+  GdkTouchGrabInfo *touch_grab = NULL;
   GdkPointerWindowInfo *pointer_info;
   gboolean block_event = FALSE;
+  guint touch_id;
 
   grab = _gdk_display_has_device_grab (display, device, serial);
   pointer_info = _gdk_display_get_pointer_info (display, device);
 
-  if (grab != NULL &&
-      !grab->owner_events)
+  if (event_in_queue &&
+      gdk_event_get_touch_id (event_in_queue, &touch_id))
+    touch_grab = _gdk_display_has_touch_grab (display, device,
+                                              touch_id, serial);
+
+  if (touch_grab)
+    {
+      if (window != touch_grab->window)
+        return;
+
+      window_event_mask = touch_grab->event_mask;
+    }
+  else if (grab != NULL &&
+           !grab->owner_events)
     {
       /* !owner_event => only report events wrt grab window, ignore rest */
       if ((GdkWindow *)window != grab->window)



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