Don't reset the lastDeviceEventTime when doing DPMS actions

Richard Hughes hughsient at gmail.com
Mon Aug 17 01:36:25 PDT 2009


2009/8/17 Peter Hutterer <peter.hutterer at who-t.net>:
> On Fri, Aug 14, 2009 at 12:07:28PM +0100, Richard Hughes wrote:
>> 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.
>> Previously gnome-power-manager was working around the idletime reset
>> by setting a 1ms second timer and ignoring the first if there was a
>> DPMS action in the last few ms. This was racey as hell, and it's
>> probably best just to fix the X bug once and for all.
>>
>> The comment for TimeSinceLastInputEvent even says "Function used for
>> screensaver purposes by the os module. Returns the time in
>> milliseconds since there last was any input." so it's clearly for use
>> for screensavers and power managers rather than "what's the last time
>> of any action in the server".
>>
>> Patch attached. Please review.
>
> Tested, seems to work fine.
> Pushed as c1d901d723c3bee523736eacc15b44a7dff484fe, thanks for the patch!
> (btw. next time please send patches to xorg-devel at freedesktop.org)

Will do, thanks. With the patch the explicit lastDeviceEventTime does
not happen (good), although dixSaveScreens still resets this on DPMS
change (not good). You can still see this if you using
http://people.freedesktop.org/~hughsient/temp/idlecounter-demo.c and
then do:

sleep 10 && xset dpms force off && sleep 1 && xset dpms force on

You'll see that the DPMS setting off /still/ resets the idletime.

The attached patch removes the reset of lastDeviceEventTime when we do
dixSaveScreens to turn on the screensaver, when the screen is turned
off. I can now remove all the bodges working around X bugs with the
previous and this patch added to Fedora 11.

Please review,

Richard.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Do-not-reset-lastDeviceEventTime-when-we-do-dixSaveS.patch
Type: text/x-patch
Size: 823 bytes
Desc: not available
Url : http://lists.x.org/archives/xorg-devel/attachments/20090817/9eecec36/attachment.bin 


More information about the xorg-devel mailing list