From 58eaf5ca169dfffa339ff39063bbd685f3a315a4 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 29 Jan 2018 12:31:53 +0100 Subject: [PATCH] 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. --- gtk/gtkwindow.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 4d8b284283..deb8d19927 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -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 */