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.
This commit is contained in:
@@ -1037,11 +1037,6 @@ switch_to_pointer_grab (GdkDisplay *display,
|
|||||||
|
|
||||||
/* We're now ungrabbed, update the window_under_pointer */
|
/* We're now ungrabbed, update the window_under_pointer */
|
||||||
_gdk_display_set_window_under_pointer (display, pointer_window);
|
_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 */
|
next_grab = NULL; /* Actually its not yet active */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (next_grab == NULL ||
|
if ((next_grab == NULL && current_grab->implicit_ungrab) ||
|
||||||
current_grab->window != next_grab->window)
|
(next_grab != NULL && current_grab->window != next_grab->window))
|
||||||
generate_grab_broken_event (GDK_WINDOW (current_grab->window),
|
generate_grab_broken_event (GDK_WINDOW (current_grab->window),
|
||||||
FALSE, current_grab->implicit,
|
FALSE, current_grab->implicit,
|
||||||
next_grab? next_grab->window : NULL);
|
next_grab? next_grab->window : NULL);
|
||||||
|
|
||||||
|
|
||||||
/* Remove old grab */
|
/* Remove old grab */
|
||||||
display->pointer_grabs =
|
display->pointer_grabs =
|
||||||
g_list_delete_link (display->pointer_grabs,
|
g_list_delete_link (display->pointer_grabs,
|
||||||
|
|||||||
Reference in New Issue
Block a user