[gnome-power-manager] Only setup the blanking timeout when a timeout is set. Fixes rh#498041
- From: Richard Hughes <rhughes src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-power-manager] Only setup the blanking timeout when a timeout is set. Fixes rh#498041
- Date: Wed, 6 May 2009 11:37:01 -0400 (EDT)
commit 0f3d267a0007573f66e2bcfd7eed1b3c8126a8f7
Author: Kyle McMartin <kmcmartin redhat com>
Date: Wed May 6 16:28:28 2009 +0100
Only setup the blanking timeout when a timeout is set. Fixes rh#498041
Signed-off-by: Richard Hughes <richard hughsie com>
---
src/gpm-idle.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/gpm-idle.c b/src/gpm-idle.c
index 3e515e6..dbbd637 100644
--- a/src/gpm-idle.c
+++ b/src/gpm-idle.c
@@ -230,15 +230,18 @@ gpm_idle_evaluate (GpmIdle *idle)
gpm_idle_set_mode (idle, GPM_IDLE_MODE_DIM);
}
- /* set up blank callback even when session is not idle */
- if (idle->priv->timeout_blank_id == 0) {
+ /* set up blank callback even when session is not idle,
+ * but only if we actually want to blank. */
+ if (idle->priv->timeout_blank_id == 0 &&
+ idle->priv->timeout_blank != 0) {
egg_debug ("setting up blank callback");
idle->priv->timeout_blank_id = g_timeout_add_seconds (idle->priv->timeout_blank, (GSourceFunc) gpm_idle_blank_cb, idle);
}
/* only do the sleep timeout when the session is idle */
if (is_idle) {
- if (idle->priv->timeout_sleep_id == 0) {
+ if (idle->priv->timeout_sleep_id == 0 &&
+ idle->priv->timeout_sleep != 0) {
egg_debug ("setting up sleep callback = %i", idle->priv->timeout_blank);
idle->priv->timeout_sleep_id = g_timeout_add_seconds (idle->priv->timeout_sleep, (GSourceFunc) gpm_idle_sleep_cb, idle);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]