Instead of tracking what cursor is the current ourself, rely on the next layer (most likely mipointer.c) do it for us. It leaves us with a bit less logic in dix/ without any significant performance loss.
Signed-off-by: Jonas Ådahl <[email protected]> --- dix/events.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/dix/events.c b/dix/events.c index efaf91d..42bf774 100644 --- a/dix/events.c +++ b/dix/events.c @@ -915,21 +915,25 @@ ChangeToCursor(DeviceIntPtr pDev, CursorPtr cursor) SpritePtr pSprite = pDev->spriteInfo->sprite; ScreenPtr pScreen; - if (cursor != pSprite->current) { - if ((pSprite->current->bits->xhot != cursor->bits->xhot) || - (pSprite->current->bits->yhot != cursor->bits->yhot)) - CheckPhysLimits(pDev, cursor, FALSE, pSprite->confined, - (ScreenPtr) NULL); + if (pSprite->current != cursor || + (pSprite->current->bits->xhot != cursor->bits->xhot) || + (pSprite->current->bits->yhot != cursor->bits->yhot)) + CheckPhysLimits(pDev, cursor, FALSE, pSprite->confined, + (ScreenPtr) NULL); + #ifdef PANORAMIX - /* XXX: is this really necessary?? (whot) */ - if (!noPanoramiXExtension) - pScreen = pSprite->screen; - else + /* XXX: is this really necessary?? (whot) */ + if (!noPanoramiXExtension) + pScreen = pSprite->screen; + else #endif - pScreen = pSprite->hotPhys.pScreen; + pScreen = pSprite->hotPhys.pScreen; - (*pScreen->DisplayCursor) (pDev, pScreen, cursor); - FreeCursor(pSprite->current, (Cursor) 0); + (*pScreen->DisplayCursor) (pDev, pScreen, cursor); + + if (cursor != pSprite->current) { + if (pSprite->current) + FreeCursor(pSprite->current, (Cursor) 0); pSprite->current = RefCursor(cursor); } } -- 2.4.3 _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
