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



commit 6b71e417006a1b894455054d29e226636fe9b35e
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 1215f8b..d03b9fe 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2161,8 +2161,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]