summaryrefslogtreecommitdiff
path: root/gtk/gtkwindow.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2018-01-29 12:31:53 +0100
committerCarlos Garnacho <carlosg@gnome.org>2018-04-05 19:26:04 +0200
commit58eaf5ca169dfffa339ff39063bbd685f3a315a4 (patch)
tree0ec23eaac8428a533a1c599dabdb9b19d89ddcd9 /gtk/gtkwindow.c
parent1ce79b29e363e585872901424d3b72041b55e3e4 (diff)
downloadgtk+-58eaf5ca169dfffa339ff39063bbd685f3a315a4.tar.gz
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.
Diffstat (limited to 'gtk/gtkwindow.c')
-rw-r--r--gtk/gtkwindow.c5
1 files changed, 5 insertions, 0 deletions
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 */