compext: 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
553ea7ebbe
commit
074fa9b0ba
|
@ -56,16 +56,13 @@ DevPrivateKeyRec CompScreenPrivateKeyRec;
|
||||||
DevPrivateKeyRec CompWindowPrivateKeyRec;
|
DevPrivateKeyRec CompWindowPrivateKeyRec;
|
||||||
DevPrivateKeyRec CompSubwindowsPrivateKeyRec;
|
DevPrivateKeyRec CompSubwindowsPrivateKeyRec;
|
||||||
|
|
||||||
static Bool
|
static void compCloseScreen(CallbackListPtr *pcbl, ScreenPtr pScreen, void *unused)
|
||||||
compCloseScreen(ScreenPtr pScreen)
|
|
||||||
{
|
{
|
||||||
CompScreenPtr cs = GetCompScreen(pScreen);
|
CompScreenPtr cs = GetCompScreen(pScreen);
|
||||||
Bool ret;
|
|
||||||
|
|
||||||
free(cs->alternateVisuals);
|
free(cs->alternateVisuals);
|
||||||
free(cs->implicitRedirectExceptions);
|
free(cs->implicitRedirectExceptions);
|
||||||
|
|
||||||
pScreen->CloseScreen = cs->CloseScreen;
|
|
||||||
pScreen->InstallColormap = cs->InstallColormap;
|
pScreen->InstallColormap = cs->InstallColormap;
|
||||||
pScreen->ChangeWindowAttributes = cs->ChangeWindowAttributes;
|
pScreen->ChangeWindowAttributes = cs->ChangeWindowAttributes;
|
||||||
pScreen->ReparentWindow = cs->ReparentWindow;
|
pScreen->ReparentWindow = cs->ReparentWindow;
|
||||||
|
@ -81,14 +78,12 @@ compCloseScreen(ScreenPtr pScreen)
|
||||||
pScreen->CopyWindow = cs->CopyWindow;
|
pScreen->CopyWindow = cs->CopyWindow;
|
||||||
pScreen->SourceValidate = cs->SourceValidate;
|
pScreen->SourceValidate = cs->SourceValidate;
|
||||||
|
|
||||||
|
dixScreenUnhookClose(pScreen, compCloseScreen);
|
||||||
dixScreenUnhookWindowDestroy(pScreen, compWindowDestroy);
|
dixScreenUnhookWindowDestroy(pScreen, compWindowDestroy);
|
||||||
dixScreenUnhookWindowPosition(pScreen, compWindowPosition);
|
dixScreenUnhookWindowPosition(pScreen, compWindowPosition);
|
||||||
|
|
||||||
free(cs);
|
free(cs);
|
||||||
dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL);
|
dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL);
|
||||||
ret = (*pScreen->CloseScreen) (pScreen);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -370,6 +365,7 @@ compScreenInit(ScreenPtr pScreen)
|
||||||
if (!disableBackingStore)
|
if (!disableBackingStore)
|
||||||
pScreen->backingStoreSupport = WhenMapped;
|
pScreen->backingStoreSupport = WhenMapped;
|
||||||
|
|
||||||
|
dixScreenHookClose(pScreen, compCloseScreen);
|
||||||
dixScreenHookWindowDestroy(pScreen, compWindowDestroy);
|
dixScreenHookWindowDestroy(pScreen, compWindowDestroy);
|
||||||
dixScreenHookWindowPosition(pScreen, compWindowPosition);
|
dixScreenHookWindowPosition(pScreen, compWindowPosition);
|
||||||
|
|
||||||
|
@ -409,9 +405,6 @@ compScreenInit(ScreenPtr pScreen)
|
||||||
cs->ChangeWindowAttributes = pScreen->ChangeWindowAttributes;
|
cs->ChangeWindowAttributes = pScreen->ChangeWindowAttributes;
|
||||||
pScreen->ChangeWindowAttributes = compChangeWindowAttributes;
|
pScreen->ChangeWindowAttributes = compChangeWindowAttributes;
|
||||||
|
|
||||||
cs->CloseScreen = pScreen->CloseScreen;
|
|
||||||
pScreen->CloseScreen = compCloseScreen;
|
|
||||||
|
|
||||||
cs->SourceValidate = pScreen->SourceValidate;
|
cs->SourceValidate = pScreen->SourceValidate;
|
||||||
pScreen->SourceValidate = compSourceValidate;
|
pScreen->SourceValidate = compSourceValidate;
|
||||||
|
|
||||||
|
|
|
@ -157,7 +157,6 @@ typedef struct _CompScreen {
|
||||||
|
|
||||||
Bool pendingScreenUpdate;
|
Bool pendingScreenUpdate;
|
||||||
|
|
||||||
CloseScreenProcPtr CloseScreen;
|
|
||||||
int numAlternateVisuals;
|
int numAlternateVisuals;
|
||||||
VisualID *alternateVisuals;
|
VisualID *alternateVisuals;
|
||||||
int numImplicitRedirectExceptions;
|
int numImplicitRedirectExceptions;
|
||||||
|
|
Loading…
Reference in New Issue