[gnome-settings-daemon] power: Watch IIO light sensor only while we're the active session



commit 6b38a7db50622acf1ca7d249f44f5eb3a3249b94
Author: Rui Matos <tiagomatos gmail com>
Date:   Tue Jan 5 18:05:43 2016 +0100

    power: Watch IIO light sensor only while we're the active session
    
    We can't change the brightness in that case but we can and should
    avoid any polling the IIO sensor daemon might have to do while
    inactive.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756539

 plugins/power/gsd-power-manager.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 1091d89..0d30f37 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2151,8 +2151,12 @@ engine_session_properties_changed_cb (GDBusProxy      *session,
                 g_debug ("Received session is active change: now %s", active ? "active" : "inactive");
                 /* when doing the fast-user-switch into a new account,
                  * ensure the new account is undimmed and with the backlight on */
-                if (active)
+                if (active) {
                         idle_set_mode (manager, GSD_POWER_IDLE_MODE_NORMAL);
+                        iio_proxy_claim_light (manager, TRUE);
+                } else {
+                        iio_proxy_claim_light (manager, FALSE);
+                }
                 g_variant_unref (v);
 
         }


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