diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c index b62b81069d..63bb316f8e 100644 --- a/gdk/gdkdisplay.c +++ b/gdk/gdkdisplay.c @@ -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); } } diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 27eb343ac4..e05a6ec6e0 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -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