[PATCH v2 4/4] render: anim cursor states can live without track screen

Peter Hutterer peter.hutterer at who-t.net
Tue May 11 17:03:26 PDT 2010


On Fri, May 07, 2010 at 06:24:19PM +0300, Tiago Vignatti wrote:
> It's enough to display animated cursors only if IsAnimCur returns true.
> 
> Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
> ---
>  include/inputstr.h |    1 -
>  render/animcur.c   |    5 +----
>  2 files changed, 1 insertions(+), 5 deletions(-)
> 
> diff --git a/include/inputstr.h b/include/inputstr.h
> index e87411f..0403e9d 100644
> --- a/include/inputstr.h
> +++ b/include/inputstr.h
> @@ -480,7 +480,6 @@ typedef struct _SpriteInfoRec {
>  
>      /* keep states for animated cursor */
>      CursorPtr           pCursor;
> -    ScreenPtr           pScreen;
>      int             elt;
>      CARD32          time;
>  
> diff --git a/render/animcur.c b/render/animcur.c
> index 8e2b498..f3e7460 100644
> --- a/render/animcur.c
> +++ b/render/animcur.c
> @@ -154,7 +154,7 @@ AnimCurScreenBlockHandler (int screenNum,
>  
>      for (dev = inputInfo.devices; dev; dev = dev->next)
>      {
> -	if (IsPointerDevice(dev) && pScreen == dev->spriteInfo->pScreen)
> +	if (IsAnimCur(dev->spriteInfo->pCursor))

I don't see this from the context, but the screen check might be needed
here. The block handler is per-screen IIRC, and it is quite possible that
one device has an animated cursor sprite on a different screen.

Did you test this with multiple MDs and multiple screens?

Cheers,
  Peter

>  	{
>  	    if (!now) now = GetTimeInMillis (); 
>  
> @@ -216,7 +216,6 @@ AnimCurDisplayCursor (DeviceIntPtr pDev,
>  		pDev->spriteInfo->elt = 0;
>  		pDev->spriteInfo->time = GetTimeInMillis () + ac->elts[0].delay;
>  		pDev->spriteInfo->pCursor = pCursor;
> -		pDev->spriteInfo->pScreen = pScreen;
>  	    }
>  	}
>  	else
> @@ -241,8 +240,6 @@ AnimCurSetCursorPosition (DeviceIntPtr pDev,
>      Bool		ret;
>      
>      Unwrap (as, pScreen, SetCursorPosition);
> -    if (pDev->spriteInfo->pCursor)
> -	pDev->spriteInfo->pScreen = pScreen;
>  
>      ret = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent);
>      Wrap (as, pScreen, SetCursorPosition, AnimCurSetCursorPosition);
> -- 
> 1.6.0.4
> 


More information about the xorg-devel mailing list