summaryrefslogtreecommitdiff
path: root/Xext/dpms.c
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2009-08-14 11:44:35 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2009-08-17 11:18:38 +1000
commitc1d901d723c3bee523736eacc15b44a7dff484fe (patch)
tree557c113e21071b53a2aa5012673b290893c25998 /Xext/dpms.c
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>
Diffstat (limited to 'Xext/dpms.c')
-rw-r--r--Xext/dpms.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/Xext/dpms.c b/Xext/dpms.c
index 21ba923d6..df63a8bf1 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;
}