sync: if the idle time was reset, force alarms to trigger (#70476)
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 16 Oct 2013 00:08:46 +0000 (10:08 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Fri, 18 Oct 2013 06:44:32 +0000 (16:44 +1000)
commit06b87aa528d7a739ba20101a1f83b1a428691a01
tree3bc098f953e43cb6177300b63c6059651ba08cbd
parentefc1035ca958f2c9d266338a308518a0834b1773
sync: if the idle time was reset, force alarms to trigger (#70476)

The time between the idle reset and the IdleTimeWakeupHandler to be called is
indeterminate. Clients with an PositiveTransition or NegativeTransition alarm
on a low threshold may miss an alarm.

Work around this by keeping a reset flag for each device. When the
WakeupHandler triggers and the reset flag is set, we force a re-calculation of
everything and pretend the current idle time is zero. Immediately after is the
next calculation with the real idle time.

Relatively reproducible test case: Set up a XSyncNegativeTransition alarm for
a threshold of 1 ms. May trigger, may not.

X.Org Bug 70476 <http://bugs.freedesktop.org/show_bug.cgi?id=70476>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Xext/sync.c
dix/events.c
include/dix.h