summaryrefslogtreecommitdiff
path: root/gdk/gdkdisplay.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2009-08-27 13:11:04 +0200
committerAlexander Larsson <alexl@redhat.com>2009-08-27 13:32:01 +0200
commit41054425b96d7af47005c1c7a12ae6445ab55b09 (patch)
treef86b7108e9ef0c506f4d581d9ae083376c51d2f1 /gdk/gdkdisplay.c
parent51f140bfdcb5a85d9fff5e187b1de92f0faf4b81 (diff)
downloadgtk+-41054425b96d7af47005c1c7a12ae6445ab55b09.tar.gz
Make sure we only send one grab broken event
We were incorrectly sending grab broken events in two places which could cause multiple events for a single grab broken.
Diffstat (limited to 'gdk/gdkdisplay.c')
-rw-r--r--gdk/gdkdisplay.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 10a0b90c32..2d094886ea 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -1037,11 +1037,6 @@ switch_to_pointer_grab (GdkDisplay *display,
/* We're now ungrabbed, update the window_under_pointer */
_gdk_display_set_window_under_pointer (display, pointer_window);
-
- if (last_grab->implicit_ungrab)
- generate_grab_broken_event (last_grab->window,
- FALSE, TRUE,
- NULL);
}
}
@@ -1089,13 +1084,12 @@ _gdk_display_pointer_grab_update (GdkDisplay *display,
next_grab = NULL; /* Actually its not yet active */
}
- if (next_grab == NULL ||
- current_grab->window != next_grab->window)
+ if ((next_grab == NULL && current_grab->implicit_ungrab) ||
+ (next_grab != NULL && current_grab->window != next_grab->window))
generate_grab_broken_event (GDK_WINDOW (current_grab->window),
FALSE, current_grab->implicit,
next_grab? next_grab->window : NULL);
-
/* Remove old grab */
display->pointer_grabs =
g_list_delete_link (display->pointer_grabs,