summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2009-08-14 11:44:35 +0100
committerKeith Packard <keithp@keithp.com>2009-09-22 12:03:33 -0700
commit468787bdd2c34f9edf46da76b6357034c216fa7b (patch)
tree6f10ac99950153efc5486c28204844e9b8443c5c
parent3044711412d0a08ba65a491bd2441c0c8980f5e2 (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> (cherry picked from commit c1d901d723c3bee523736eacc15b44a7dff484fe) Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--Xext/dpms.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/Xext/dpms.c b/Xext/dpms.c
index bad7aa64f..d3e0dde8b 100644
--- a/Xext/dpms.c
+++ b/Xext/dpms.c
@@ -219,19 +219,10 @@ ProcDPMSForceLevel(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;
}