Window: Do not connect to NULL screen in init()

Do not connect to get_settings_for_screen() if we have no screen…

Use g_signal_connect(), not connect_object(), to match how set_screen()
makes this same connection, and how finalize() already disconnects it.

https://bugzilla.gnome.org/show_bug.cgi?id=705640
This commit is contained in:
Daniel Boles 2017-08-31 20:19:58 +01:00
parent 6609173779
commit 6984d0847b

View File

@ -1858,9 +1858,10 @@ gtk_window_init (GtkWindow *window)
gtk_window_update_debugging ();
#ifdef GDK_WINDOWING_X11
g_signal_connect_object (gtk_settings_get_for_screen (priv->screen),
"notify::gtk-application-prefer-dark-theme",
G_CALLBACK (gtk_window_on_theme_variant_changed), window, 0);
if (priv->screen)
g_signal_connect (gtk_settings_get_for_screen (priv->screen),
"notify::gtk-application-prefer-dark-theme",
G_CALLBACK (gtk_window_on_theme_variant_changed), window);
#endif
widget_node = gtk_widget_get_css_node (GTK_WIDGET (window));