diff options
Diffstat (limited to 'xfixes/cursor.c')
-rwxr-xr-x | xfixes/cursor.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/xfixes/cursor.c b/xfixes/cursor.c index 450f366f2..975ebc36d 100755 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -55,8 +55,7 @@ static RESTYPE CursorClientType; static RESTYPE CursorHideCountType; static RESTYPE CursorWindowType; -static int CursorScreenPrivateIndex = -1; -static int CursorGeneration; +static DevPrivateKey CursorScreenPrivateKey = &CursorScreenPrivateKey; static CursorPtr CursorCurrent; static CursorPtr pInvisibleCursor = NULL; @@ -113,9 +112,9 @@ typedef struct _CursorScreen { CursorHideCountPtr pCursorHideCounts; } CursorScreenRec, *CursorScreenPtr; -#define GetCursorScreen(s) ((CursorScreenPtr) ((s)->devPrivates[CursorScreenPrivateIndex].ptr)) -#define GetCursorScreenIfSet(s) ((CursorScreenPrivateIndex != -1) ? GetCursorScreen(s) : NULL) -#define SetCursorScreen(s,p) ((s)->devPrivates[CursorScreenPrivateIndex].ptr = (pointer) (p)) +#define GetCursorScreen(s) ((CursorScreenPtr)dixLookupPrivate(&(s)->devPrivates, CursorScreenPrivateKey)) +#define GetCursorScreenIfSet(s) GetCursorScreen(s) +#define SetCursorScreen(s,p) dixSetPrivate(&(s)->devPrivates, CursorScreenPrivateKey, p) #define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func) #define Unwrap(as,s,elt) ((s)->elt = (as)->elt) @@ -171,8 +170,6 @@ CursorCloseScreen (int index, ScreenPtr pScreen) deleteCursorHideCountsForScreen(pScreen); ret = (*pScreen->CloseScreen) (index, pScreen); xfree (cs); - if (index == 0) - CursorScreenPrivateIndex = -1; return ret; } @@ -1011,13 +1008,6 @@ XFixesCursorInit (void) { int i; - if (CursorGeneration != serverGeneration) - { - CursorScreenPrivateIndex = AllocateScreenPrivateIndex (); - if (CursorScreenPrivateIndex < 0) - return FALSE; - CursorGeneration = serverGeneration; - } for (i = 0; i < screenInfo.numScreens; i++) { ScreenPtr pScreen = screenInfo.screens[i]; |