summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2009-08-14 10:44:35 (GMT)
committerPeter Hutterer <peter.hutterer@who-t.net>2009-08-17 01:18:38 (GMT)
commitc1d901d723c3bee523736eacc15b44a7dff484fe (patch)
tree557c113e21071b53a2aa5012673b290893c25998
parentdca4de72d375c4b9bcdd25b151e291a77a5b06cc (diff)
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>
-rw-r--r--Xext/dpms.c17
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;
}