gtkwindow: Unset focus grab_widget if it ends up unmapped

This may result on the later emission of crossing events, with one of the
sides being already unmapped/unrealized. The widget being unmapped will
result on repick and emission of a set of crossing events anyway.
This commit is contained in:
Carlos Garnacho 2018-01-29 12:31:53 +01:00
parent 1ce79b29e3
commit 58eaf5ca16

View File

@ -11292,6 +11292,11 @@ gtk_window_update_pointer_focus_on_state_change (GtkWindow *window,
gtk_pointer_focus_ref (focus);
if (focus->grab_widget &&
(focus->grab_widget == widget ||
gtk_widget_is_ancestor (focus->grab_widget, widget)))
gtk_pointer_focus_set_implicit_grab (focus, NULL);
if (GTK_WIDGET (focus->toplevel) == widget)
{
/* Unmapping the toplevel, remove pointer focus */