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 c1d901d723)

Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Richard Hughes 2009-08-14 11:44:35 +01:00 committed by Keith Packard
parent 3044711412
commit 468787bdd2

View file

@ -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;
}