[PATCH xserver 1/2] animcur: Fix transitions between animated cursors

Adam Jackson ajax at redhat.com
Tue Jan 9 18:46:56 UTC 2018


On Tue, 2018-01-09 at 10:08 -0800, Aaron Plattner wrote:
> On 01/09/2018 08:51 AM, Adam Jackson wrote:
> 
> > @@ -165,8 +174,10 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
> >          if (pCursor != pDev->spriteInfo->anim.pCursor) {
> >              AnimCurPtr ac = GetAnimCur(pCursor);
> >  
> > -            ret = (*pScreen->DisplayCursor)
> > -                (pDev, pScreen, ac->elts[0].pCursor);
> > +            AnimCurCancelTimer(pDev);
> > +            ret = (*pScreen->DisplayCursor) (pDev, pScreen,
> > +                                             ac->elts[0].pCursor);
> > +
> 
> This is a slight change in behavior if DisplayCursor fails since it will
> cancel the previous timer whereas before it wouldn't. Are there any
> weird cases where failing to change the cursor is expected and canceling
> animation of the previous cursor would be a problem?

Mm, not really. Practically speaking ->DisplayCursor is always
miPointerDisplayCursor, which only fails for keyboard devices. Which I
guess means the second patch is more paranoid than it needs to be and
unwinding would probably go fine on BadAlloc. Meh.

> Assuming not, both changes
> Reviewed-by: Aaron Plattner <aplattner at nvidia.com>
> 
> I'll try to put together a build to test these today.

Cool, thanks for helping dig into this.

- ajax


More information about the xorg-devel mailing list