[gnome-settings-daemon] Fix dimming for the smart screen power saving feature



commit 335154b8a6ca13a2e791d7e1f0d9642e8c91eb20
Author: Richard Hughes <richard hughsie com>
Date:   Fri Jan 11 11:18:00 2013 +0000

    Fix dimming for the smart screen power saving feature
    
    Correctly detect errors when getting the idletime. This requires gnome-desktop
    from git to work correctly, so bump up the BR version.

 configure.ac                      |    2 +-
 plugins/power/gsd-power-manager.c |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b02fc40..c2b66d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,7 +47,7 @@ GLIB_REQUIRED_VERSION=2.35.3
 GIO_REQUIRED_VERSION=${GLIB_REQUIRED_VERSION}
 GTK_REQUIRED_VERSION=3.3.18
 GCONF_REQUIRED_VERSION=2.6.1
-GNOME_DESKTOP_REQUIRED_VERSION=3.7.1
+GNOME_DESKTOP_REQUIRED_VERSION=3.7.3
 LIBNOTIFY_REQUIRED_VERSION=0.7.3
 UPOWER_GLIB_REQUIRED_VERSION=0.9.1
 PA_REQUIRED_VERSION=2.0
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index f264913..96e1e0b 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -3260,16 +3260,16 @@ idle_configure (GsdPowerManager *manager)
 static gboolean
 idle_set_timeout_dim (GsdPowerManager *manager, guint timeout)
 {
-        guint idle_time;
+        gint64 idle_time;
 
-        idle_time = gnome_idle_monitor_get_idletime (manager->priv->idle_monitor) / 1000;
-        if (idle_time == 0)
+        idle_time = gnome_idle_monitor_get_idletime (manager->priv->idle_monitor);
+        if (idle_time < 0)
                 return FALSE;
 
         g_debug ("Setting dim idle timeout: %ds", timeout);
         if (timeout > 0) {
                 manager->priv->idle_dim_id = gnome_idle_monitor_add_watch (manager->priv->idle_monitor,
-                                                                          idle_adjust_timeout (idle_time, timeout) * 1000,
+                                                                          idle_adjust_timeout (idle_time / 1000, timeout) * 1000,
                                                                           NULL, NULL, NULL);
         } else {
                 gnome_idle_monitor_remove_watch (manager->priv->idle_monitor,



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