Commit aa8cea95 authored by Pauli Nieminen's avatar Pauli Nieminen Committed by Daniel Stone
Browse files

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: default avatarPauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Daniel Stone's avatarDaniel Stone <daniel@fooishbar.org>
parent 91beeee0
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment