window: unset menubar before unsetting focus on dispose()

If the menubar has an app-menu popover, and it is shown at the time of
disposing the window, it will attempt to transfer focus back to the
previous focus widget when undoing modality, even though the dispose()
code already did set_focus(NULL) previously.

At the time the popover is removed, there aren't many hints as to whether
the toplevel or the focus widget are being destroyed (ie. not still under
in_destruction), so just swap the order of these two calls.

For every other popover, this would all happen within dispose/destroy,
which is handled better.
This commit is contained in:
Carlos Garnacho 2014-10-14 15:30:34 +02:00
parent e0040acefc
commit 1ae5c2a138

View File

@ -2938,9 +2938,9 @@ gtk_window_dispose (GObject *object)
GtkWindow *window = GTK_WINDOW (object);
GtkWindowPrivate *priv = window->priv;
unset_titlebar (window);
gtk_window_set_focus (window, NULL);
gtk_window_set_default (window, NULL);
unset_titlebar (window);
remove_attach_widget (window);
G_OBJECT_CLASS (gtk_window_parent_class)->dispose (object);