[gnome-settings-daemon] power: Save last requested idle mode while temporarily unidle



commit b98655a1d5f52c9c786b40fac31d5dc9d2f55e06
Author: Rui Matos <tiagomatos gmail com>
Date:   Sun May 3 19:21:26 2015 +0200

    power: Save last requested idle mode while temporarily unidle
    
    If one of our idle watches triggers while we're temporarily unidle we
    should save and switch to it when that period ends otherwise we would
    ignore any idle request transitions in that period and always go back
    to the state where we were when becoming temporarily unidle.
    
    This prevents the following bug:
    
    1. Laptop enters sleep
    2. Lid open, wake up, idle time gets reset, we enter NORMAL state
    3. There's a notification so gnome-shell asks us to go temporarily
       unidle while we're in NORMAL state
    4. The 15s inactivity watch is triggered and we switch to BLANK
    5. The unidle timer is triggered and we switch back to NORMAL since
       that's the state we were in when it started
    
    Result is that the screen is left turned ON indefinitely after waking
    from sleep if there's a notification when we wake up.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=748849

 plugins/power/gsd-power-manager.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 96f0ed9..afe9405 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2028,9 +2028,10 @@ static void
 idle_set_mode_no_temp (GsdPowerManager  *manager,
                        GsdPowerIdleMode  mode)
 {
-        if (manager->priv->temporary_unidle_on_ac_id != 0 &&
-            manager->priv->previous_idle_mode == mode)
+        if (manager->priv->temporary_unidle_on_ac_id != 0) {
+                manager->priv->previous_idle_mode = mode;
                 return;
+        }
 
         idle_set_mode (manager, mode);
 }


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