From c3eb248cf93a3afd9168acfb88254606beddd7a8 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 14 Mar 2007 13:21:33 +1030 Subject: [PATCH] dix: fix: don't skip first item in list when seeking for a device cursor. --- dix/window.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dix/window.c b/dix/window.c index 3d7972812..6c3558343 100644 --- a/dix/window.c +++ b/dix/window.c @@ -3930,6 +3930,7 @@ CursorPtr WindowGetDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev) /* Searches for a DevCursorNode for the given window and device. If one is * found, return True and set pNode and pPrev to the node and to the node * before the node respectively. Otherwise return False. + * If the device is the first in list, pPrev is set to NULL. */ static Bool WindowSeekDeviceCursor(WindowPtr pWin, @@ -3943,6 +3944,14 @@ WindowSeekDeviceCursor(WindowPtr pWin, return FALSE; pList = pWin->optional->deviceCursors; + + if (pList && pList->dev == pDev) + { + *pNode = pList; + *pPrev = NULL; + return TRUE; + } + while(pList) { if (pList->next)