summaryrefslogtreecommitdiff
path: root/xserver/xfixes
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2018-02-18 17:16:39 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2018-02-18 17:16:39 +0000
commit59f36f1072242e554a7d6d64138db12b321a86bf (patch)
tree2a157e8f9e17d04bc4e0efde0ca7e9db5346cc37 /xserver/xfixes
parent1d0ff518f50b7e33f90ad75637db6090055f2d96 (diff)
Update to xserver 1.19.6. bug fix release
Diffstat (limited to 'xserver/xfixes')
-rw-r--r--xserver/xfixes/cursor.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/xserver/xfixes/cursor.c b/xserver/xfixes/cursor.c
index 6e84d71f1..a150f450b 100644
--- a/xserver/xfixes/cursor.c
+++ b/xserver/xfixes/cursor.c
@@ -61,7 +61,6 @@
static RESTYPE CursorClientType;
static RESTYPE CursorHideCountType;
static RESTYPE CursorWindowType;
-static CursorPtr CursorCurrent[MAXDEVICES];
static DevPrivateKeyRec CursorScreenPrivateKeyRec;
@@ -132,10 +131,26 @@ typedef struct _CursorScreen {
Bool CursorVisible = FALSE;
Bool EnableCursor = TRUE;
+static CursorPtr
+CursorForDevice(DeviceIntPtr pDev)
+{
+ if (pDev && pDev->spriteInfo && pDev->spriteInfo->sprite)
+ return pDev->spriteInfo->sprite->current;
+
+ return NULL;
+}
+
+static CursorPtr
+CursorForClient(ClientPtr client)
+{
+ return CursorForDevice(PickPointer(client));
+}
+
static Bool
CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{
CursorScreenPtr cs = GetCursorScreen(pScreen);
+ CursorPtr pOldCursor = CursorForDevice(pDev);
Bool ret;
DisplayCursorProcPtr backupProc;
@@ -150,11 +165,10 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor);
}
- if (pCursor != CursorCurrent[pDev->id]) {
+ if (pCursor != pOldCursor) {
CursorEventPtr e;
UpdateCurrentTimeIf();
- CursorCurrent[pDev->id] = pCursor;
for (e = cursorEvents; e; e = e->next) {
if ((e->eventMask & XFixesDisplayCursorNotifyMask)) {
xXFixesCursorNotifyEvent ev = {
@@ -351,7 +365,7 @@ ProcXFixesGetCursorImage(ClientPtr client)
int npixels, width, height, rc, x, y;
REQUEST_SIZE_MATCH(xXFixesGetCursorImageReq);
- pCursor = CursorCurrent[PickPointer(client)->id];
+ pCursor = CursorForClient(client);
if (!pCursor)
return BadCursor;
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pCursor->id, RT_CURSOR,
@@ -500,7 +514,7 @@ ProcXFixesGetCursorImageAndName(ClientPtr client)
int rc, x, y;
REQUEST_SIZE_MATCH(xXFixesGetCursorImageAndNameReq);
- pCursor = CursorCurrent[PickPointer(client)->id];
+ pCursor = CursorForClient(client);
if (!pCursor)
return BadCursor;
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pCursor->id, RT_CURSOR,
@@ -874,7 +888,7 @@ ProcXFixesHideCursor(ClientPtr client)
for (dev = inputInfo.devices; dev; dev = dev->next) {
if (IsMaster(dev) && IsPointerDevice(dev))
CursorDisplayCursor(dev, pWin->drawable.pScreen,
- CursorCurrent[dev->id]);
+ CursorForDevice(dev));
}
}
@@ -969,7 +983,7 @@ CursorFreeHideCount(void *data, XID id)
deleteCursorHideCount(pChc, pChc->pScreen);
for (dev = inputInfo.devices; dev; dev = dev->next) {
if (IsMaster(dev) && IsPointerDevice(dev))
- CursorDisplayCursor(dev, pScreen, CursorCurrent[dev->id]);
+ CursorDisplayCursor(dev, pScreen, CursorForDevice(dev));
}
return 1;