Blob Blame Raw
From c1d901d723c3bee523736eacc15b44a7dff484fe Mon Sep 17 00:00:00 2001
From: Richard Hughes <richard@hughsie.com>
Date: Fri, 14 Aug 2009 11:44:35 +0100
Subject: [PATCH] Don't reset the lastDeviceEventTime when doing DPMS actions

When we change the DPMS mode, don't play games with the last event time as
this breaks applications using IDLETIME to turn the backlight off after a
preset time.

This patch fixes gnome-power-manager and xfce-power-manager

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
 Xext/dpms.c |   17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/Xext/dpms.c b/Xext/dpms.c
index 21ba923..df63a8b 100644
--- a/Xext/dpms.c
+++ b/Xext/dpms.c
@@ -177,19 +177,10 @@ ProcDPMSForceLevel(ClientPtr client)
     if (!DPMSEnabled)
 	return BadMatch;
 
-    if (stuff->level == DPMSModeOn) {
-      lastDeviceEventTime.milliseconds =
-          GetTimeInMillis();
-    } else if (stuff->level == DPMSModeStandby) {
-      lastDeviceEventTime.milliseconds =
-          GetTimeInMillis() -  DPMSStandbyTime;
-    } else if (stuff->level == DPMSModeSuspend) {
-      lastDeviceEventTime.milliseconds =
-          GetTimeInMillis() -  DPMSSuspendTime;
-    } else if (stuff->level == DPMSModeOff) {
-      lastDeviceEventTime.milliseconds =
-          GetTimeInMillis() -  DPMSOffTime;
-    } else {
+    if (stuff->level != DPMSModeOn &&
+        stuff->level != DPMSModeStandby &&
+        stuff->level != DPMSModeSuspend &&
+        stuff->level != DPMSModeOff) {
 	client->errorValue = stuff->level;
 	return BadValue;
     }
-- 
1.6.3.rc1.2.g0164.dirty