From: Carlos Garnacho Date: Wed, 4 Jan 2012 23:51:32 +0000 (+0100) Subject: gdk: Have touch grabs behave like the implicit grab wrt crossing events X-Git-Url: http://pileus.org/git/?a=commitdiff_plain;h=2f2774b7a934610f6158dfcef25516ac36941642;p=~andy%2Fgtk 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. --- diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index f5f07b21a..06bb95804 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -8340,14 +8340,27 @@ 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; + GdkEventSequence *sequence; grab = _gdk_display_has_device_grab (display, device, serial); pointer_info = _gdk_display_get_pointer_info (display, device); - if (grab != NULL && - !grab->owner_events) + sequence = gdk_event_get_event_sequence (event_in_queue); + if (sequence) + touch_grab = _gdk_display_has_touch_grab (display, device, sequence, 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)