[gtk+] Window: Do not connect to NULL screen in init()
- From: Daniel Boles <dboles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Window: Do not connect to NULL screen in init()
- Date: Thu, 31 Aug 2017 19:32:25 +0000 (UTC)
commit 6984d0847b7e70bc7108c7b298bab1c85e708f7c
Author: Daniel Boles <dboles src gnome org>
Date: Thu Aug 31 20:19:58 2017 +0100
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
gtk/gtkwindow.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index a6b64d8..2e8f5b4 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -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));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]