diff --git a/composite/compinit.c b/composite/compinit.c index 80cc5ce2b..f75a0a514 100644 --- a/composite/compinit.c +++ b/composite/compinit.c @@ -56,16 +56,13 @@ DevPrivateKeyRec CompScreenPrivateKeyRec; DevPrivateKeyRec CompWindowPrivateKeyRec; DevPrivateKeyRec CompSubwindowsPrivateKeyRec; -static Bool -compCloseScreen(ScreenPtr pScreen) +static void compCloseScreen(CallbackListPtr *pcbl, ScreenPtr pScreen, void *unused) { CompScreenPtr cs = GetCompScreen(pScreen); - Bool ret; free(cs->alternateVisuals); free(cs->implicitRedirectExceptions); - pScreen->CloseScreen = cs->CloseScreen; pScreen->InstallColormap = cs->InstallColormap; pScreen->ChangeWindowAttributes = cs->ChangeWindowAttributes; pScreen->ReparentWindow = cs->ReparentWindow; @@ -81,14 +78,12 @@ compCloseScreen(ScreenPtr pScreen) pScreen->CopyWindow = cs->CopyWindow; pScreen->SourceValidate = cs->SourceValidate; + dixScreenUnhookClose(pScreen, compCloseScreen); dixScreenUnhookWindowDestroy(pScreen, compWindowDestroy); dixScreenUnhookWindowPosition(pScreen, compWindowPosition); free(cs); dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL); - ret = (*pScreen->CloseScreen) (pScreen); - - return ret; } static void @@ -370,6 +365,7 @@ compScreenInit(ScreenPtr pScreen) if (!disableBackingStore) pScreen->backingStoreSupport = WhenMapped; + dixScreenHookClose(pScreen, compCloseScreen); dixScreenHookWindowDestroy(pScreen, compWindowDestroy); dixScreenHookWindowPosition(pScreen, compWindowPosition); @@ -409,9 +405,6 @@ compScreenInit(ScreenPtr pScreen) cs->ChangeWindowAttributes = pScreen->ChangeWindowAttributes; pScreen->ChangeWindowAttributes = compChangeWindowAttributes; - cs->CloseScreen = pScreen->CloseScreen; - pScreen->CloseScreen = compCloseScreen; - cs->SourceValidate = pScreen->SourceValidate; pScreen->SourceValidate = compSourceValidate; diff --git a/composite/compint.h b/composite/compint.h index 42fe9f45b..e01fee9fc 100644 --- a/composite/compint.h +++ b/composite/compint.h @@ -157,7 +157,6 @@ typedef struct _CompScreen { Bool pendingScreenUpdate; - CloseScreenProcPtr CloseScreen; int numAlternateVisuals; VisualID *alternateVisuals; int numImplicitRedirectExceptions;