[gnome-settings-daemon/gnome-3-14] power: Save last requested idle mode while temporarily unidle
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/gnome-3-14] power: Save last requested idle mode while temporarily unidle
- Date: Mon, 4 May 2015 13:33:43 +0000 (UTC)
commit 82e66ef921d33ae04e22ba62b5647c0077e21e00
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 eafa082..ffcdd7b 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2010,9 +2010,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]