damage: 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
c14783ef81
commit
c335d5a92e
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "dix/screen_hooks_priv.h"
|
||||
#include "os/osdep.h"
|
||||
|
||||
#include <X11/X.h>
|
||||
|
@ -1576,22 +1577,14 @@ damageSetWindowPixmap(WindowPtr pWindow, PixmapPtr pPixmap)
|
|||
}
|
||||
}
|
||||
|
||||
static Bool
|
||||
damageDestroyWindow(WindowPtr pWindow)
|
||||
static void
|
||||
damageWindowDestroy(CallbackListPtr *pcbl, ScreenPtr pScreen, WindowPtr pWindow)
|
||||
{
|
||||
DamagePtr pDamage;
|
||||
ScreenPtr pScreen = pWindow->drawable.pScreen;
|
||||
Bool ret;
|
||||
|
||||
damageScrPriv(pScreen);
|
||||
|
||||
while ((pDamage = damageGetWinPriv(pWindow))) {
|
||||
DamageDestroy(pDamage);
|
||||
}
|
||||
unwrap(pScrPriv, pScreen, DestroyWindow);
|
||||
ret = (*pScreen->DestroyWindow) (pWindow);
|
||||
wrap(pScrPriv, pScreen, DestroyWindow, damageDestroyWindow);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static Bool
|
||||
|
@ -1599,6 +1592,8 @@ damageCloseScreen(ScreenPtr pScreen)
|
|||
{
|
||||
damageScrPriv(pScreen);
|
||||
|
||||
dixScreenUnhookWindowDestroy(pScreen, damageWindowDestroy);
|
||||
|
||||
unwrap(pScrPriv, pScreen, DestroyPixmap);
|
||||
unwrap(pScrPriv, pScreen, CreateGC);
|
||||
unwrap(pScrPriv, pScreen, CopyWindow);
|
||||
|
@ -1691,9 +1686,10 @@ DamageSetup(ScreenPtr pScreen)
|
|||
pScrPriv->internalLevel = 0;
|
||||
pScrPriv->pScreenDamage = 0;
|
||||
|
||||
dixScreenHookWindowDestroy(pScreen, damageWindowDestroy);
|
||||
|
||||
wrap(pScrPriv, pScreen, DestroyPixmap, damageDestroyPixmap);
|
||||
wrap(pScrPriv, pScreen, CreateGC, damageCreateGC);
|
||||
wrap(pScrPriv, pScreen, DestroyWindow, damageDestroyWindow);
|
||||
wrap(pScrPriv, pScreen, SetWindowPixmap, damageSetWindowPixmap);
|
||||
wrap(pScrPriv, pScreen, CopyWindow, damageCopyWindow);
|
||||
wrap(pScrPriv, pScreen, CloseScreen, damageCloseScreen);
|
||||
|
|
|
@ -65,7 +65,6 @@ typedef struct _damageScrPriv {
|
|||
CreateGCProcPtr CreateGC;
|
||||
DestroyPixmapProcPtr DestroyPixmap;
|
||||
SetWindowPixmapProcPtr SetWindowPixmap;
|
||||
DestroyWindowProcPtr DestroyWindow;
|
||||
CompositeProcPtr Composite;
|
||||
GlyphsProcPtr Glyphs;
|
||||
AddTrapsProcPtr AddTraps;
|
||||
|
|
Loading…
Reference in New Issue