dix: add screen hook for post-close
In contrast to the already existing ScreenClose hook, this one is called *after* the driver's CloseScreen() proc. That's required for some extensions (eg. damage) where drivers still need to call in inside of their CloseScreen procs. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
4036b8c163
commit
56650ba873
|
@ -23,6 +23,7 @@ void dixFreeScreen(ScreenPtr pScreen)
|
|||
DeleteCallbackList(&pScreen->hookWindowDestroy);
|
||||
DeleteCallbackList(&pScreen->hookWindowPosition);
|
||||
DeleteCallbackList(&pScreen->hookClose);
|
||||
DeleteCallbackList(&pScreen->hookPostClose);
|
||||
DeleteCallbackList(&pScreen->hookPixmapDestroy);
|
||||
free(pScreen);
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
DECLARE_HOOK_PROC(WindowDestroy, hookWindowDestroy, XorgScreenWindowDestroyProcPtr);
|
||||
DECLARE_HOOK_PROC(WindowPosition, hookWindowPosition, XorgScreenWindowPositionProcPtr);
|
||||
DECLARE_HOOK_PROC(Close, hookClose, XorgScreenCloseProcPtr);
|
||||
DECLARE_HOOK_PROC(PostClose, hookPostClose, XorgScreenCloseProcPtr);
|
||||
DECLARE_HOOK_PROC(PixmapDestroy, hookPixmapDestroy, XorgScreenPixmapDestroyProcPtr);
|
||||
DECLARE_HOOK_PROC(PostCreateResources, hookPostCreateResources,
|
||||
XorgScreenPostCreateResourcesProcPtr);
|
||||
|
@ -71,6 +72,8 @@ void dixScreenRaiseClose(ScreenPtr pScreen) {
|
|||
|
||||
if (pScreen->CloseScreen)
|
||||
pScreen->CloseScreen(pScreen);
|
||||
|
||||
CallCallbacks(&pScreen->hookPostClose, NULL);
|
||||
}
|
||||
|
||||
void dixScreenRaisePixmapDestroy(PixmapPtr pPixmap)
|
||||
|
|
|
@ -147,6 +147,37 @@ _X_EXPORT
|
|||
void dixScreenUnhookClose(ScreenPtr pScreen,
|
||||
XorgScreenCloseProcPtr func);
|
||||
|
||||
/**
|
||||
* @brief register a screen post close notify hook on the given screen
|
||||
*
|
||||
* @param pScreen pointer to the screen to register the notify hook into
|
||||
* @param func pointer to the hook function
|
||||
*
|
||||
* In contrast to Close hook, it's called *after* the driver's CloseScreen()
|
||||
* proc had been called.
|
||||
*
|
||||
* When registration fails, the server aborts.
|
||||
**/
|
||||
void dixScreenHookPostClose(ScreenPtr pScreen,
|
||||
XorgScreenCloseProcPtr func);
|
||||
|
||||
/**
|
||||
* @brief unregister a screen close notify hook on the given screen
|
||||
*
|
||||
* @param pScreen pointer to the screen to unregister the hook from
|
||||
* @param func pointer to the hook function
|
||||
* @param arg opaque pointer passed to the destructor
|
||||
*
|
||||
* @see dixScreenHookPostClose
|
||||
*
|
||||
* Unregister a screen close notify hook registered via @ref dixScreenHookPostClose
|
||||
*
|
||||
* In contrast to Close hook, it's called *after* the driver's CloseScreen()
|
||||
* proc had been called.
|
||||
**/
|
||||
void dixScreenUnhookPostClose(ScreenPtr pScreen,
|
||||
XorgScreenCloseProcPtr func);
|
||||
|
||||
/* prototype of pixmap destroy notification handler */
|
||||
typedef void (*XorgScreenPixmapDestroyProcPtr)(CallbackListPtr *pcbl,
|
||||
ScreenPtr pScreen,
|
||||
|
|
|
@ -696,6 +696,10 @@ typedef struct _Screen {
|
|||
CallbackListPtr hookPostCreateResources;
|
||||
|
||||
SetWindowVRRModeProcPtr SetWindowVRRMode;
|
||||
|
||||
/* additional screen post-close notify hooks (replaces wrapping CloseScreen)
|
||||
should NOT be touched outside of DIX core */
|
||||
CallbackListPtr hookPostClose;
|
||||
} ScreenRec;
|
||||
|
||||
static inline RegionPtr
|
||||
|
|
Loading…
Reference in New Issue