From ceaf4277447407a7430b9bc3205462fbdbae0e39 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 12 Feb 2018 15:35:05 -0500 Subject: [PATCH] xfixes: Restore monitoring of animated cursors This was broken by: commit aa6651f83c698e8cc40de61aad36c73ca7a6adcf Author: Adam Jackson Date: Thu Jun 8 16:23:12 2017 -0400 xfixes: Remove the CursorCurrent array As of that change we look up the current cursor dynamically instead of trying to track every time it's set through ->DisplayCursor. That would work, except the 'bits' of an animated cursor is a transparent 1x1 pixel. So now, look up whether there's an animated cursor, and use its current frame if so. Signed-off-by: Adam Jackson --- xfixes/cursor.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xfixes/cursor.c b/xfixes/cursor.c index cb38796c017c..d4b68f3af2c1 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -134,8 +134,11 @@ Bool EnableCursor = TRUE; static CursorPtr CursorForDevice(DeviceIntPtr pDev) { - if (pDev && pDev->spriteInfo && pDev->spriteInfo->sprite) + if (pDev && pDev->spriteInfo && pDev->spriteInfo->sprite) { + if (pDev->spriteInfo->anim.pCursor) + return pDev->spriteInfo->anim.pCursor; return pDev->spriteInfo->sprite->current; + } return NULL; } -- 2.17.0