[PATCH] dix/events: Set currentTime to the given time stamp in NoticeTime

Keith Packard keithp at keithp.com
Sat Apr 25 23:45:46 PDT 2015

Rui Matos <tiagomatos at gmail.com> writes:

> The refactoring in commit efc1035ca958f2c9d266338a308518a0834b1773
> removed the actual update of currentTime.
> Signed-off-by: Rui Matos <tiagomatos at gmail.com>
> ---
> I noticed this while investigating why hitting a key on GNOME's lock
> screen would wake the monitor from DPMS but instantly enter DPMS
> again. GNOME uses a 15 sec idle alarm to enter DPMS while the screen
> is locked and it turns out that the X server was triggering this alarm
> immediately when pressing a key.
> Drilling down into the server I noticed that IdleTimeQueryValue() in
> IdleTimeWakeupHandler() was getting values bigger than 15 sec in this
> case which is clearly wrong since I had just pressed a key.
> That's how I arrived at this patch, please review, thanks.

Thanks for pointing out this bug; always nice to have a good explanation
like this. I think your fix is sufficient, but I also think the bug
highlights that the current NoticeTime function is ignoring the 'time'
argument, and that essentially all callers to it (save
NoticeTimeMillis) were passing it currentTime as that argument.

Here's an alternate patch, which has NoticeTimeMillis assigning
currentTime, removes the 'time' argument from NoticeTime, and changes
the other callers of that function to stop passing currentTime.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-dix-NoticeTime-ignores-time-argument.patch
Type: text/x-diff
Size: 3088 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150425/8a37751e/attachment.patch>
-------------- next part --------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150425/8a37751e/attachment.sig>

More information about the xorg-devel mailing list