summaryrefslogtreecommitdiff
path: root/gdk/gdkdisplay.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2012-02-21 03:12:10 +0100
committerMatthias Clasen <mclasen@redhat.com>2012-03-01 16:25:26 -0500
commitb897ba0cd8f874877c35a204abf89dbe755f1d09 (patch)
tree2cd7fd35d62dc76443cdb9f0ed756f53ea9d250c /gdk/gdkdisplay.c
parent6efe1167152718b3ce4bd4d0c0c7cc9b8879f6b8 (diff)
downloadgtk+-b897ba0cd8f874877c35a204abf89dbe755f1d09.tar.gz
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
Diffstat (limited to 'gdk/gdkdisplay.c')
-rw-r--r--gdk/gdkdisplay.c16
1 files changed, 5 insertions, 11 deletions
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);
}
}