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.
This commit is contained in:
Carlos Garnacho 2012-01-05 00:51:32 +01:00 committed by Matthias Clasen
parent c72a77b04c
commit 2f2774b7a9

View File

@ -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)