xfixes: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so use the new screen close notify hook instead. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
938e006c43
commit
cc993c3133
|
@ -119,7 +119,6 @@ typedef struct _CursorHideCountRec {
|
|||
|
||||
typedef struct _CursorScreen {
|
||||
DisplayCursorProcPtr DisplayCursor;
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
CursorHideCountPtr pCursorHideCounts;
|
||||
} CursorScreenRec, *CursorScreenPtr;
|
||||
|
||||
|
@ -193,20 +192,15 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static Bool
|
||||
CursorCloseScreen(ScreenPtr pScreen)
|
||||
static void CursorScreenClose(CallbackListPtr *pcbl, ScreenPtr pScreen, void *unused)
|
||||
{
|
||||
CursorScreenPtr cs = GetCursorScreen(pScreen);
|
||||
Bool ret;
|
||||
_X_UNUSED CloseScreenProcPtr close_proc;
|
||||
_X_UNUSED DisplayCursorProcPtr display_proc;
|
||||
|
||||
Unwrap(cs, pScreen, CloseScreen, close_proc);
|
||||
dixScreenUnhookClose(pScreen, CursorScreenClose);
|
||||
Unwrap(cs, pScreen, DisplayCursor, display_proc);
|
||||
deleteCursorHideCountsForScreen(pScreen);
|
||||
ret = (*pScreen->CloseScreen) (pScreen);
|
||||
free(cs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define CursorAllEvents (XFixesDisplayCursorNotifyMask)
|
||||
|
@ -1069,7 +1063,7 @@ XFixesCursorInit(void)
|
|||
cs = (CursorScreenPtr) calloc(1, sizeof(CursorScreenRec));
|
||||
if (!cs)
|
||||
return FALSE;
|
||||
Wrap(cs, pScreen, CloseScreen, CursorCloseScreen);
|
||||
dixScreenHookClose(pScreen, CursorScreenClose);
|
||||
Wrap(cs, pScreen, DisplayCursor, CursorDisplayCursor);
|
||||
cs->pCursorHideCounts = NULL;
|
||||
SetCursorScreen(pScreen, cs);
|
||||
|
|
Loading…
Reference in New Issue