PKGBUILDs/extra/xorg-server/dpms-dont-reset-lastdeviceeventtime.patch
2009-10-09 21:23:22 -05:00

43 lines
1.5 KiB
Diff

From c1d901d723c3bee523736eacc15b44a7dff484fe Mon Sep 17 00:00:00 2001
From: Richard Hughes <richard@hughsie.com>
Date: Fri, 14 Aug 2009 10:44:35 +0000
Subject: 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>
---
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;
}
--
cgit v0.8.2