Commit 9d1e5aa0 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Merge branch 'fix-focus-unsetting' into 'master'

window: Fix deferred focus unsetting

Closes #3413

See merge request GNOME/gtk!3446
parents 24cd0567 4d19de4e
Pipeline #275166 passed with stages
in 26 minutes and 25 seconds
......@@ -2011,6 +2011,8 @@ gtk_window_root_set_focus (GtkRoot *root,
g_clear_object (&old_focus);
priv->move_focus = FALSE;
g_object_notify (G_OBJECT (self), "focus-widget");
}
......@@ -2288,6 +2290,8 @@ gtk_window_set_default_widget (GtkWindow *window,
priv->default_widget = default_widget;
priv->unset_default = FALSE;
if (priv->default_widget)
{
if (priv->focus_widget == NULL ||
......@@ -4671,16 +4675,10 @@ maybe_unset_focus_and_default (GtkWindow *window)
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
if (priv->move_focus)
{
gtk_widget_child_focus (GTK_WIDGET (window), GTK_DIR_TAB_FORWARD);
priv->move_focus = FALSE;
}
gtk_widget_child_focus (GTK_WIDGET (window), GTK_DIR_TAB_FORWARD);
if (priv->unset_default)
{
gtk_window_set_default_widget (window, NULL);
priv->unset_default = FALSE;
}
gtk_window_set_default_widget (window, NULL);
}
static gboolean
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment