diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index a0c0cc6ed3..a74ab7e995 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -5005,8 +5005,15 @@ gtk_window_finalize (GObject *object) } if (priv->screen) - g_signal_handlers_disconnect_by_func (priv->screen, - gtk_window_on_composited_changed, window); + { + g_signal_handlers_disconnect_by_func (priv->screen, + gtk_window_on_composited_changed, window); +#ifdef GDK_WINDOWING_X11 + g_signal_handlers_disconnect_by_func (gtk_settings_get_for_screen (priv->screen), + gtk_window_on_theme_variant_changed, + window); +#endif + } g_free (priv->startup_id); @@ -5016,12 +5023,6 @@ gtk_window_finalize (GObject *object) priv->mnemonics_display_timeout_id = 0; } -#ifdef GDK_WINDOWING_X11 - g_signal_handlers_disconnect_by_func (gtk_settings_get_default (), - gtk_window_on_theme_variant_changed, - window); -#endif - G_OBJECT_CLASS (gtk_window_parent_class)->finalize (object); }