84a64a
From c1d901d723c3bee523736eacc15b44a7dff484fe Mon Sep 17 00:00:00 2001
84a64a
From: Richard Hughes <richard@hughsie.com>
84a64a
Date: Fri, 14 Aug 2009 11:44:35 +0100
84a64a
Subject: [PATCH] Don't reset the lastDeviceEventTime when doing DPMS actions
84a64a
84a64a
When we change the DPMS mode, don't play games with the last event time as
84a64a
this breaks applications using IDLETIME to turn the backlight off after a
84a64a
preset time.
84a64a
84a64a
This patch fixes gnome-power-manager and xfce-power-manager
84a64a
84a64a
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
84a64a
---
84a64a
 Xext/dpms.c |   17 ++++-------------
84a64a
 1 files changed, 4 insertions(+), 13 deletions(-)
84a64a
84a64a
diff --git a/Xext/dpms.c b/Xext/dpms.c
84a64a
index 21ba923..df63a8b 100644
84a64a
--- a/Xext/dpms.c
84a64a
+++ b/Xext/dpms.c
84a64a
@@ -177,19 +177,10 @@ ProcDPMSForceLevel(ClientPtr client)
84a64a
     if (!DPMSEnabled)
84a64a
 	return BadMatch;
84a64a
 
84a64a
-    if (stuff->level == DPMSModeOn) {
84a64a
-      lastDeviceEventTime.milliseconds =
84a64a
-          GetTimeInMillis();
84a64a
-    } else if (stuff->level == DPMSModeStandby) {
84a64a
-      lastDeviceEventTime.milliseconds =
84a64a
-          GetTimeInMillis() -  DPMSStandbyTime;
84a64a
-    } else if (stuff->level == DPMSModeSuspend) {
84a64a
-      lastDeviceEventTime.milliseconds =
84a64a
-          GetTimeInMillis() -  DPMSSuspendTime;
84a64a
-    } else if (stuff->level == DPMSModeOff) {
84a64a
-      lastDeviceEventTime.milliseconds =
84a64a
-          GetTimeInMillis() -  DPMSOffTime;
84a64a
-    } else {
84a64a
+    if (stuff->level != DPMSModeOn &&
84a64a
+        stuff->level != DPMSModeStandby &&
84a64a
+        stuff->level != DPMSModeSuspend &&
84a64a
+        stuff->level != DPMSModeOff) {
84a64a
 	client->errorValue = stuff->level;
84a64a
 	return BadValue;
84a64a
     }
84a64a
-- 
84a64a
1.6.3.rc1.2.g0164.dirty
84a64a