diff --git a/src/backends/meta-color-manager.c b/src/backends/meta-color-manager.c index 6b7fca07e..5e866a150 100644 --- a/src/backends/meta-color-manager.c +++ b/src/backends/meta-color-manager.c @@ -306,16 +306,14 @@ update_all_gamma (MetaColorManager *color_manager) } static void -on_temperature_changed (MetaDBusSettingsDaemonColor *gsd_color, - GParamSpec *pspec, - MetaColorManager *color_manager) +update_temperature (MetaColorManager *color_manager) { MetaColorManagerPrivate *priv = meta_color_manager_get_instance_private (color_manager); unsigned int temperature; - temperature = meta_dbus_settings_daemon_color_get_temperature (gsd_color); - if (priv->temperature == temperature) + temperature = meta_dbus_settings_daemon_color_get_temperature (priv->gsd_color); + if (temperature == 0 || priv->temperature == temperature) return; if (temperature < 1000 || temperature > 10000) @@ -329,6 +327,14 @@ on_temperature_changed (MetaDBusSettingsDaemonColor *gsd_color, update_all_gamma (color_manager); } +static void +on_temperature_changed (MetaDBusSettingsDaemonColor *gsd_color, + GParamSpec *pspec, + MetaColorManager *color_manager) +{ + update_temperature (color_manager); +} + static void on_gsd_color_ready (GObject *source_object, GAsyncResult *res, @@ -359,7 +365,7 @@ on_gsd_color_ready (GObject *source_object, G_CALLBACK (on_temperature_changed), color_manager); - update_all_gamma (color_manager); + update_temperature (color_manager); } static void