[gnome-settings-daemon] power: Don't change the brightness on inactive sessions



commit 367d9dd051d1a1a52bc9fc4d64e7dc5f9a907482
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Feb 15 18:28:08 2013 +0100

    power: Don't change the brightness on inactive sessions
    
    Spotted by Cosimo Cecchi.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=693910

 plugins/power/gsd-power-manager.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index efa8404..1e8bd87 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -3157,11 +3157,16 @@ engine_session_properties_changed_cb (GDBusProxy      *session,
 
         v = g_variant_lookup_value (changed, "SessionIsActive", G_VARIANT_TYPE_BOOLEAN);
         if (v) {
-                g_variant_unref (v);
-                g_debug ("Received session is active change");
+                gboolean active;
+
+                active = g_variant_get_boolean (v);
+                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 */
-                idle_set_mode (manager, GSD_POWER_IDLE_MODE_NORMAL);
+                if (active)
+                        idle_set_mode (manager, GSD_POWER_IDLE_MODE_NORMAL);
+                g_variant_unref (v);
+
         }
 
         v = g_variant_lookup_value (changed, "InhibitedActions", G_VARIANT_TYPE_UINT32);


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