gdk: Don't fully destroy the implicit touch grab on ::grab-broken

the backing GdkTouchGrabInfo will be needed if the overriding device
grab finishes before the touch does in order to send events back to
the implicit grab window. Instead, wait until the touch is physically
finished before removing the matching GdkTouchGrabInfo
This commit is contained in:
Carlos Garnacho 2012-02-21 03:12:10 +01:00 committed by Matthias Clasen
parent 6efe116715
commit b897ba0cd8
2 changed files with 9 additions and 14 deletions

View File

@ -700,24 +700,18 @@ _gdk_display_break_touch_grabs (GdkDisplay *display,
GdkDevice *device,
GdkWindow *new_grab_window)
{
guint i = 0;
guint i;
while (i < display->touch_implicit_grabs->len)
for (i = 0; i < display->touch_implicit_grabs->len; i++)
{
GdkTouchGrabInfo *info;
info = &g_array_index (display->touch_implicit_grabs,
GdkTouchGrabInfo, i);
if (info->device == device &&
info->window != new_grab_window)
{
generate_grab_broken_event (GDK_WINDOW (info->window),
device, TRUE, new_grab_window);
g_array_remove_index_fast (display->touch_implicit_grabs, i);
}
else
i++;
if (info->device == device && info->window != new_grab_window)
generate_grab_broken_event (GDK_WINDOW (info->window),
device, TRUE, new_grab_window);
}
}

View File

@ -9252,9 +9252,9 @@ proxy_pointer_event (GdkDisplay *display,
if (pointer_info->need_touch_press_enter &&
gdk_device_get_source (pointer_info->last_slave) != GDK_SOURCE_TOUCHSCREEN &&
gdk_device_get_source (pointer_info->last_slave) != GDK_SOURCE_TOUCHPAD) &&
gdk_device_get_source (pointer_info->last_slave) != GDK_SOURCE_TOUCHPAD &&
(source_event->type != GDK_TOUCH_UPDATE ||
_gdk_event_get_pointer_emulated (source_event))
_gdk_event_get_pointer_emulated (source_event)))
{
pointer_info->need_touch_press_enter = FALSE;
need_synthetic_enter = TRUE;
@ -9687,7 +9687,8 @@ proxy_button_event (GdkEvent *source_event,
if ((type == GDK_TOUCH_END &&
_gdk_event_get_pointer_emulated (source_event)) &&
pointer_window == pointer_info->window_under_pointer &&
gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN)
(gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN ||
gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHPAD))
{
/* Synthesize a leave notify event
* whenever a touch device is released