[gnome-settings-daemon] power: Don't add SCREENSAVER_FADE_TIME twice
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] power: Don't add SCREENSAVER_FADE_TIME twice
- Date: Thu, 17 Jan 2013 06:57:38 +0000 (UTC)
commit e3c9fbc73c4b3646aad084c2b4d60be2e97b7c49
Author: Bastien Nocera <hadess hadess net>
Date: Wed Jan 16 15:26:05 2013 +0100
power: Don't add SCREENSAVER_FADE_TIME twice
https://bugzilla.gnome.org/show_bug.cgi?id=691002
plugins/power/gsd-power-manager.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index af7e069..76efbfa 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2698,16 +2698,17 @@ idle_configure (GsdPowerManager *manager)
} else if (on_battery) {
timeout_blank = g_settings_get_int (manager->priv->settings,
"sleep-display-battery");
- timeout_blank += SCREENSAVER_FADE_TIME;
+ if (timeout_blank != 0)
+ timeout_blank += SCREENSAVER_FADE_TIME;
} else {
timeout_blank = g_settings_get_int (manager->priv->settings,
"sleep-display-ac");
- timeout_blank += SCREENSAVER_FADE_TIME;
+ if (timeout_blank != 0)
+ timeout_blank += SCREENSAVER_FADE_TIME;
}
if (timeout_blank != 0) {
g_debug ("setting up blank callback for %is", timeout_blank);
- timeout_blank += SCREENSAVER_FADE_TIME;
manager->priv->idle_blank_id = gnome_idle_monitor_add_watch (manager->priv->idle_monitor,
timeout_blank * 1000,
NULL, NULL, NULL);
@@ -2728,7 +2729,7 @@ idle_configure (GsdPowerManager *manager)
if (timeout_sleep != 0) {
if (timeout_blank && timeout_blank >= timeout_sleep) {
/* adjust sleep timer to blank timer and allow 2 secs margin delay */
- timeout_sleep = timeout_blank + SCREENSAVER_FADE_TIME + 2;
+ timeout_sleep = timeout_blank + 2;
g_debug ("blank timer >= sleep timer, setting up sleep callback %is", timeout_sleep);
} else {
g_debug ("setting up sleep callback %is", timeout_sleep);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]