summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorPauli Nieminen <ext-pauli.nieminen@nokia.com>2010-12-30 19:19:32 +0200
committerAdam Jackson <ajax@redhat.com>2011-01-06 15:15:53 -0500
commita87a5b7e83349d3871fcde71fec08f85fa16dc0b (patch)
tree1ca1271b3cb738dbf120879a46764ba371aa1a1d /render
parentaec278eb65fe1ca98ab551a8c3873a7195bad540 (diff)
render: Don't filter 0 return from GetTimeInMillis
In animate cursor block handler code assumes GetTimeInMillis returns always nonzero value. This isn't true when time wraps around. To prevent any problems in case GetTimeInMillis would return zero use activeDevice variable to track if we have received time. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> (cherry picked from commit aa8cea953dc66bcf4cb4d08f2681f9e6cb1bc8c5)
Diffstat (limited to 'render')
-rw-r--r--render/animcur.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/render/animcur.c b/render/animcur.c
index 2160f5043..1a8ca43ba 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -150,6 +150,7 @@ AnimCurScreenBlockHandler (int screenNum,
ScreenPtr pScreen = screenInfo.screens[screenNum];
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
DeviceIntPtr dev;
+ Bool activeDevice = FALSE;
CARD32 now = 0,
soonest = ~0; /* earliest time to wakeup again */
@@ -157,7 +158,10 @@ AnimCurScreenBlockHandler (int screenNum,
{
if (IsPointerDevice(dev) && pScreen == dev->spriteInfo->anim.pScreen)
{
- if (!now) now = GetTimeInMillis ();
+ if (!activeDevice) {
+ now = GetTimeInMillis ();
+ activeDevice = TRUE;
+ }
if ((INT32) (now - dev->spriteInfo->anim.time) >= 0)
{
@@ -187,7 +191,7 @@ AnimCurScreenBlockHandler (int screenNum,
}
}
- if (now)
+ if (activeDevice)
AdjustWaitForDelay (pTimeout, soonest - now);
Unwrap (as, pScreen, BlockHandler);