window: Update has-focus property

Update the :has-focus property of the focus
widget when the active status of the window
changes.

We change the property after generating the
GDK_CROSSING_ACTIVE crossing events.
This commit is contained in:
Matthias Clasen 2022-03-07 11:35:09 -07:00
parent f545d7a910
commit d9ad7884e9

View File

@ -5864,9 +5864,15 @@ _gtk_window_set_is_active (GtkWindow *window,
focus = g_object_ref (priv->focus_widget);
if (is_active)
{
synthesize_focus_change_events (window, NULL, focus, GTK_CROSSING_ACTIVE);
gtk_widget_set_has_focus (focus, TRUE);
}
else
{
synthesize_focus_change_events (window, focus, NULL, GTK_CROSSING_ACTIVE);
gtk_widget_set_has_focus (focus, FALSE);
}
g_object_unref (focus);
}