composite: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so use the new window destructor hook instead. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
f208c7a971
commit
c3d780d07f
|
@ -44,6 +44,7 @@
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
|
#include "dix/screen_hooks_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
|
|
||||||
#include "compint.h"
|
#include "compint.h"
|
||||||
|
@ -76,12 +77,13 @@ compCloseScreen(ScreenPtr pScreen)
|
||||||
pScreen->ClipNotify = cs->ClipNotify;
|
pScreen->ClipNotify = cs->ClipNotify;
|
||||||
pScreen->UnrealizeWindow = cs->UnrealizeWindow;
|
pScreen->UnrealizeWindow = cs->UnrealizeWindow;
|
||||||
pScreen->RealizeWindow = cs->RealizeWindow;
|
pScreen->RealizeWindow = cs->RealizeWindow;
|
||||||
pScreen->DestroyWindow = cs->DestroyWindow;
|
|
||||||
pScreen->CreateWindow = cs->CreateWindow;
|
pScreen->CreateWindow = cs->CreateWindow;
|
||||||
pScreen->CopyWindow = cs->CopyWindow;
|
pScreen->CopyWindow = cs->CopyWindow;
|
||||||
pScreen->PositionWindow = cs->PositionWindow;
|
pScreen->PositionWindow = cs->PositionWindow;
|
||||||
pScreen->SourceValidate = cs->SourceValidate;
|
pScreen->SourceValidate = cs->SourceValidate;
|
||||||
|
|
||||||
|
dixScreenUnhookWindowDestroy(pScreen, compWindowDestroy);
|
||||||
|
|
||||||
free(cs);
|
free(cs);
|
||||||
dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL);
|
dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL);
|
||||||
ret = (*pScreen->CloseScreen) (pScreen);
|
ret = (*pScreen->CloseScreen) (pScreen);
|
||||||
|
@ -368,6 +370,8 @@ compScreenInit(ScreenPtr pScreen)
|
||||||
if (!disableBackingStore)
|
if (!disableBackingStore)
|
||||||
pScreen->backingStoreSupport = WhenMapped;
|
pScreen->backingStoreSupport = WhenMapped;
|
||||||
|
|
||||||
|
dixScreenHookWindowDestroy(pScreen, compWindowDestroy);
|
||||||
|
|
||||||
cs->PositionWindow = pScreen->PositionWindow;
|
cs->PositionWindow = pScreen->PositionWindow;
|
||||||
pScreen->PositionWindow = compPositionWindow;
|
pScreen->PositionWindow = compPositionWindow;
|
||||||
|
|
||||||
|
@ -377,9 +381,6 @@ compScreenInit(ScreenPtr pScreen)
|
||||||
cs->CreateWindow = pScreen->CreateWindow;
|
cs->CreateWindow = pScreen->CreateWindow;
|
||||||
pScreen->CreateWindow = compCreateWindow;
|
pScreen->CreateWindow = compCreateWindow;
|
||||||
|
|
||||||
cs->DestroyWindow = pScreen->DestroyWindow;
|
|
||||||
pScreen->DestroyWindow = compDestroyWindow;
|
|
||||||
|
|
||||||
cs->RealizeWindow = pScreen->RealizeWindow;
|
cs->RealizeWindow = pScreen->RealizeWindow;
|
||||||
pScreen->RealizeWindow = compRealizeWindow;
|
pScreen->RealizeWindow = compRealizeWindow;
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,6 @@ typedef struct _CompScreen {
|
||||||
PositionWindowProcPtr PositionWindow;
|
PositionWindowProcPtr PositionWindow;
|
||||||
CopyWindowProcPtr CopyWindow;
|
CopyWindowProcPtr CopyWindow;
|
||||||
CreateWindowProcPtr CreateWindow;
|
CreateWindowProcPtr CreateWindow;
|
||||||
DestroyWindowProcPtr DestroyWindow;
|
|
||||||
RealizeWindowProcPtr RealizeWindow;
|
RealizeWindowProcPtr RealizeWindow;
|
||||||
UnrealizeWindowProcPtr UnrealizeWindow;
|
UnrealizeWindowProcPtr UnrealizeWindow;
|
||||||
ClipNotifyProcPtr ClipNotify;
|
ClipNotifyProcPtr ClipNotify;
|
||||||
|
@ -308,8 +307,7 @@ void
|
||||||
Bool
|
Bool
|
||||||
compCreateWindow(WindowPtr pWin);
|
compCreateWindow(WindowPtr pWin);
|
||||||
|
|
||||||
Bool
|
void compWindowDestroy(CallbackListPtr *pcbl, ScreenPtr pScreen, WindowPtr pWin);
|
||||||
compDestroyWindow(WindowPtr pWin);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
compSetRedirectBorderClip(WindowPtr pWin, RegionPtr pRegion);
|
compSetRedirectBorderClip(WindowPtr pWin, RegionPtr pRegion);
|
||||||
|
|
|
@ -596,16 +596,12 @@ compCreateWindow(WindowPtr pWin)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool
|
void compWindowDestroy(CallbackListPtr *pcbl, ScreenPtr pScreen, WindowPtr pWin)
|
||||||
compDestroyWindow(WindowPtr pWin)
|
|
||||||
{
|
{
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
|
||||||
CompScreenPtr cs = GetCompScreen(pScreen);
|
CompScreenPtr cs = GetCompScreen(pScreen);
|
||||||
CompWindowPtr cw;
|
CompWindowPtr cw;
|
||||||
CompSubwindowsPtr csw;
|
CompSubwindowsPtr csw;
|
||||||
Bool ret;
|
|
||||||
|
|
||||||
pScreen->DestroyWindow = cs->DestroyWindow;
|
|
||||||
while ((cw = GetCompWindow(pWin)))
|
while ((cw = GetCompWindow(pWin)))
|
||||||
FreeResource(cw->clients->id, X11_RESTYPE_NONE);
|
FreeResource(cw->clients->id, X11_RESTYPE_NONE);
|
||||||
while ((csw = GetCompSubwindows(pWin)))
|
while ((csw = GetCompSubwindows(pWin)))
|
||||||
|
@ -617,16 +613,12 @@ compDestroyWindow(WindowPtr pWin)
|
||||||
compSetParentPixmap(pWin);
|
compSetParentPixmap(pWin);
|
||||||
dixDestroyPixmap(pPixmap, 0);
|
dixDestroyPixmap(pPixmap, 0);
|
||||||
}
|
}
|
||||||
ret = (*pScreen->DestroyWindow) (pWin);
|
|
||||||
cs->DestroyWindow = pScreen->DestroyWindow;
|
|
||||||
pScreen->DestroyWindow = compDestroyWindow;
|
|
||||||
|
|
||||||
/* Did we just destroy the overlay window? */
|
/* Did we just destroy the overlay window? */
|
||||||
if (pWin == cs->pOverlayWin)
|
if (pWin == cs->pOverlayWin)
|
||||||
cs->pOverlayWin = NULL;
|
cs->pOverlayWin = NULL;
|
||||||
|
|
||||||
/* compCheckTree (pWin->drawable.pScreen); can't check -- tree isn't good*/
|
/* compCheckTree (pWin->drawable.pScreen); can't check -- tree isn't good*/
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue