summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dix/globals.c2
-rw-r--r--hw/dmx/dmxcursor.h6
-rw-r--r--hw/xfree86/loader/dixsym.c1
-rw-r--r--hw/xfree86/modes/xf86Cursors.c4
-rw-r--r--hw/xfree86/ramdac/xf86Cursor.c6
-rw-r--r--hw/xfree86/ramdac/xf86HWCurs.c4
-rw-r--r--hw/xnest/XNCursor.h6
-rw-r--r--include/cursor.h2
-rw-r--r--mi/midispcur.c14
9 files changed, 25 insertions, 20 deletions
diff --git a/dix/globals.c b/dix/globals.c
index 630d29167..80a9ff504 100644
--- a/dix/globals.c
+++ b/dix/globals.c
@@ -142,6 +142,8 @@ CursorPtr rootCursor;
Bool blackRoot=FALSE;
Bool whiteRoot=FALSE;
+_X_EXPORT int cursorScreenDevPriv[MAXSCREENS];
+
_X_EXPORT TimeStamp currentTime;
_X_EXPORT TimeStamp lastDeviceEventTime;
diff --git a/hw/dmx/dmxcursor.h b/hw/dmx/dmxcursor.h
index da8ea5e85..5242268c1 100644
--- a/hw/dmx/dmxcursor.h
+++ b/hw/dmx/dmxcursor.h
@@ -63,10 +63,10 @@ extern void dmxHideCursor(DMXScreenInfo *dmxScreen);
extern void dmxBECreateCursor(ScreenPtr pScreen, CursorPtr pCursor);
extern Bool dmxBEFreeCursor(ScreenPtr pScreen, CursorPtr pCursor);
-#define DMX_GET_CURSOR_PRIV(_pCursor, _pScreen) \
- ((dmxCursorPrivPtr)dixLookupPrivate(&(_pCursor)->devPrivates, _pScreen))
+#define DMX_GET_CURSOR_PRIV(_pCursor, _pScreen) ((dmxCursorPrivPtr) \
+ dixLookupPrivate(&(_pCursor)->devPrivates, CursorScreenKey(_pScreen)))
#define DMX_SET_CURSOR_PRIV(_pCursor, _pScreen, v) \
- dixSetPrivate(&(_pCursor)->devPrivates, _pScreen, v)
+ dixSetPrivate(&(_pCursor)->devPrivates, CursorScreenKey(_pScreen), v)
#endif /* DMXCURSOR_H */
diff --git a/hw/xfree86/loader/dixsym.c b/hw/xfree86/loader/dixsym.c
index e9de050f9..a18a0ea27 100644
--- a/hw/xfree86/loader/dixsym.c
+++ b/hw/xfree86/loader/dixsym.c
@@ -112,6 +112,7 @@ _X_HIDDEN void *dixLookupTab[] = {
SYMFUNC(QueryColors)
/* cursor.c */
SYMFUNC(FreeCursor)
+ SYMVAR(cursorScreenDevPriv)
/* deprecated.c */
SYMFUNC(LookupClient)
SYMFUNC(LookupDrawable)
diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index 5dddaddb0..a7ed5c4d4 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -230,7 +230,7 @@ xf86_set_cursor_colors (ScrnInfoPtr scrn, int bg, int fg)
int c;
CARD8 *bits = cursor ?
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
- dixLookupPrivate(&cursor->devPrivates, screen)
+ dixLookupPrivate(&cursor->devPrivates, CursorScreenKey(screen))
#else
cursor->devPriv[screen->myNum]
#endif
@@ -617,7 +617,7 @@ xf86_reload_cursors (ScreenPtr screen)
if (cursor)
{
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
- void *src = dixLookupPrivate(&cursor->devPrivates, screen);
+ void *src = dixLookupPrivate(&cursor->devPrivates, CursorScreenKey(screen));
#else
void *src = cursor->devPriv[screen->myNum];
#endif
diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c
index 3c98f6e7d..be4fb908e 100644
--- a/hw/xfree86/ramdac/xf86Cursor.c
+++ b/hw/xfree86/ramdac/xf86Cursor.c
@@ -269,7 +269,7 @@ xf86CursorRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs)
&pScreen->devPrivates, xf86CursorScreenKey);
if (pCurs->refcnt <= 1)
- dixSetPrivate(&pCurs->devPrivates, pScreen, NULL);
+ dixSetPrivate(&pCurs->devPrivates, CursorScreenKey(pScreen), NULL);
return (*ScreenPriv->spriteFuncs->RealizeCursor)(pDev, pScreen, pCurs);
}
@@ -282,8 +282,8 @@ xf86CursorUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
&pScreen->devPrivates, xf86CursorScreenKey);
if (pCurs->refcnt <= 1) {
- xfree(dixLookupPrivate(&pCurs->devPrivates, pScreen));
- dixSetPrivate(&pCurs->devPrivates, pScreen, NULL);
+ xfree(dixLookupPrivate(&pCurs->devPrivates, CursorScreenKey(pScreen)));
+ dixSetPrivate(&pCurs->devPrivates, CursorScreenKey(pScreen), NULL);
}
return (*ScreenPriv->spriteFuncs->UnrealizeCursor)(pDev, pScreen, pCurs);
diff --git a/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c
index d10e283d7..ea0523362 100644
--- a/hw/xfree86/ramdac/xf86HWCurs.c
+++ b/hw/xfree86/ramdac/xf86HWCurs.c
@@ -123,7 +123,7 @@ xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
return;
}
- bits = (unsigned char *)dixLookupPrivate(&pCurs->devPrivates, pScreen);
+ bits = dixLookupPrivate(&pCurs->devPrivates, CursorScreenKey(pScreen));
x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX;
y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY;
@@ -133,7 +133,7 @@ xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
#endif
if (!bits) {
bits = (*infoPtr->RealizeCursor)(infoPtr, pCurs);
- dixSetPrivate(&pCurs->devPrivates, pScreen, bits);
+ dixSetPrivate(&pCurs->devPrivates, CursorScreenKey(pScreen), bits);
}
if (!(infoPtr->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))
diff --git a/hw/xnest/XNCursor.h b/hw/xnest/XNCursor.h
index d99355565..ab2c3b1e6 100644
--- a/hw/xnest/XNCursor.h
+++ b/hw/xnest/XNCursor.h
@@ -28,11 +28,11 @@ typedef struct {
Cursor cursor;
} xnestPrivCursor;
-#define xnestGetCursorPriv(pCursor, pScreen) \
- ((xnestPrivCursor *)dixLookupPrivate(&(pCursor)->devPrivates, pScreen))
+#define xnestGetCursorPriv(pCursor, pScreen) ((xnestPrivCursor *) \
+ dixLookupPrivate(&(pCursor)->devPrivates, CursorScreenKey(pScreen)))
#define xnestSetCursorPriv(pCursor, pScreen, v) \
- dixSetPrivate(&(pCursor)->devPrivates, pScreen, v)
+ dixSetPrivate(&(pCursor)->devPrivates, CursorScreenKey(pScreen), v)
#define xnestCursor(pCursor, pScreen) \
(xnestGetCursorPriv(pCursor, pScreen)->cursor)
diff --git a/include/cursor.h b/include/cursor.h
index f86d94ca5..93e264dd2 100644
--- a/include/cursor.h
+++ b/include/cursor.h
@@ -65,6 +65,8 @@ typedef struct _Cursor *CursorPtr;
typedef struct _CursorMetric *CursorMetricPtr;
extern CursorPtr rootCursor;
+extern int cursorScreenDevPriv[MAXSCREENS];
+#define CursorScreenKey(pScreen) (cursorScreenDevPriv + (pScreen)->myNum)
extern int FreeCursor(
pointer /*pCurs*/,
diff --git a/mi/midispcur.c b/mi/midispcur.c
index 875527727..1f2d8cf03 100644
--- a/mi/midispcur.c
+++ b/mi/midispcur.c
@@ -178,7 +178,7 @@ static Bool
miDCRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
{
if (pCursor->bits->refcnt <= 1)
- dixSetPrivate(&pCursor->bits->devPrivates, pScreen, NULL);
+ dixSetPrivate(&pCursor->bits->devPrivates, CursorScreenKey(pScreen), NULL);
return TRUE;
}
@@ -277,7 +277,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
xfree ((pointer) pPriv);
return (miDCCursorPtr)NULL;
}
- dixSetPrivate(&pCursor->bits->devPrivates, pScreen, pPriv);
+ dixSetPrivate(&pCursor->bits->devPrivates, CursorScreenKey(pScreen), pPriv);
return pPriv;
}
pPriv->pPicture = 0;
@@ -295,7 +295,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
xfree ((pointer) pPriv);
return (miDCCursorPtr)NULL;
}
- dixSetPrivate(&pCursor->bits->devPrivates, pScreen, pPriv);
+ dixSetPrivate(&pCursor->bits->devPrivates, CursorScreenKey(pScreen), pPriv);
/* create the two sets of bits, clipping as appropriate */
@@ -340,7 +340,7 @@ miDCUnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
miDCCursorPtr pPriv;
pPriv = (miDCCursorPtr)dixLookupPrivate(&pCursor->bits->devPrivates,
- pScreen);
+ CursorScreenKey(pScreen));
if (pPriv && (pCursor->bits->refcnt <= 1))
{
if (pPriv->sourceBits)
@@ -352,7 +352,7 @@ miDCUnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
FreePicture (pPriv->pPicture, 0);
#endif
xfree ((pointer) pPriv);
- dixSetPrivate(&pCursor->bits->devPrivates, pScreen, NULL);
+ dixSetPrivate(&pCursor->bits->devPrivates, CursorScreenKey(pScreen), NULL);
}
return TRUE;
}
@@ -446,7 +446,7 @@ miDCPutUpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
WindowPtr pWin;
pPriv = (miDCCursorPtr)dixLookupPrivate(&pCursor->bits->devPrivates,
- pScreen);
+ CursorScreenKey(pScreen));
if (!pPriv)
{
pPriv = miDCRealize(pScreen, pCursor);
@@ -756,7 +756,7 @@ miDCMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
PixmapPtr pTemp;
pPriv = (miDCCursorPtr)dixLookupPrivate(&pCursor->bits->devPrivates,
- pScreen);
+ CursorScreenKey(pScreen));
if (!pPriv)
{
pPriv = miDCRealize(pScreen, pCursor);