summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Matos <tiagomatos@gmail.com>2015-05-03 19:21:26 +0200
committerRui Matos <tiagomatos@gmail.com>2015-05-04 15:33:00 +0200
commitb98655a1d5f52c9c786b40fac31d5dc9d2f55e06 (patch)
tree5fc62989a1c617aae983f294ed41652ff7e3fe79
parent9ac05a277804a387d7c33305e68071544ad05566 (diff)
downloadgnome-settings-daemon-b98655a1d5f52c9c786b40fac31d5dc9d2f55e06.tar.gz
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
-rw-r--r--plugins/power/gsd-power-manager.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 96f0ed95..afe9405b 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);
}