[gnome-settings-daemon/gnome-3-22] power: "0.0" is not a valid light level



commit 0993e0784ba8e87941adcf9d17a0a5b3cab02266
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Aug 11 17:50:29 2017 +0200

    power: "0.0" is not a valid light level
    
    This is the equivalent of "undefined" for the accelerometer
    orientation. Don't use it to prime our nice ambient light
    readings curve.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786164

 plugins/power/gsd-power-manager.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 55664c4..e5d1d4d 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2500,7 +2500,7 @@ iio_proxy_changed (GsdPowerManager *manager)
         if (val_has == NULL || !g_variant_get_boolean (val_has))
                 goto out;
         val_als = g_dbus_proxy_get_cached_property (manager->priv->iio_proxy, "LightLevel");
-        if (val_als == NULL)
+        if (val_als == NULL || g_variant_get_double (val_als) == 0.0) {
                 goto out;
         manager->priv->ambient_last_absolute = g_variant_get_double (val_als);
         g_debug ("Read last absolute light level: %f", manager->priv->ambient_last_absolute);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]