miext: rootless: 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
1bc857d30f
commit
0a516b5690
|
@ -81,7 +81,6 @@ typedef struct _RootlessScreenRec {
|
||||||
|
|
||||||
// Wrapped screen functions
|
// Wrapped screen functions
|
||||||
CreateScreenResourcesProcPtr CreateScreenResources;
|
CreateScreenResourcesProcPtr CreateScreenResources;
|
||||||
CloseScreenProcPtr CloseScreen;
|
|
||||||
|
|
||||||
CreateWindowProcPtr CreateWindow;
|
CreateWindowProcPtr CreateWindow;
|
||||||
RealizeWindowProcPtr RealizeWindow;
|
RealizeWindowProcPtr RealizeWindow;
|
||||||
|
|
|
@ -133,15 +133,11 @@ RootlessCreateScreenResources(ScreenPtr pScreen)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static void RootlessCloseScreen(CallbackListPtr *pcbl, ScreenPtr pScreen, void *unused)
|
||||||
RootlessCloseScreen(ScreenPtr pScreen)
|
|
||||||
{
|
{
|
||||||
RootlessScreenRec *s;
|
dixScreenUnhookClose(pScreen, RootlessCloseScreen);
|
||||||
|
|
||||||
s = SCREENREC(pScreen);
|
RootlessScreenRec *s = SCREENREC(pScreen);
|
||||||
|
|
||||||
// fixme unwrap everything that was wrapped?
|
|
||||||
pScreen->CloseScreen = s->CloseScreen;
|
|
||||||
|
|
||||||
if (s->pixmap_data != NULL) {
|
if (s->pixmap_data != NULL) {
|
||||||
free(s->pixmap_data);
|
free(s->pixmap_data);
|
||||||
|
@ -150,7 +146,7 @@ RootlessCloseScreen(ScreenPtr pScreen)
|
||||||
}
|
}
|
||||||
|
|
||||||
free(s);
|
free(s);
|
||||||
return pScreen->CloseScreen(pScreen);
|
dixSetPrivate(&(pScreen)->devPrivates, rootlessScreenPrivateKey, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -650,6 +646,7 @@ RootlessWrap(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
RootlessScreenRec *s = SCREENREC(pScreen);
|
RootlessScreenRec *s = SCREENREC(pScreen);
|
||||||
|
|
||||||
|
dixScreenHookClose(pScreen, RootlessCloseScreen);
|
||||||
dixScreenHookWindowDestroy(pScreen, RootlessWindowDestroy);
|
dixScreenHookWindowDestroy(pScreen, RootlessWindowDestroy);
|
||||||
dixScreenHookWindowPosition(pScreen, RootlessWindowPosition);
|
dixScreenHookWindowPosition(pScreen, RootlessWindowPosition);
|
||||||
|
|
||||||
|
@ -663,7 +660,6 @@ RootlessWrap(ScreenPtr pScreen)
|
||||||
pScreen->a = Rootless##a
|
pScreen->a = Rootless##a
|
||||||
|
|
||||||
WRAP(CreateScreenResources);
|
WRAP(CreateScreenResources);
|
||||||
WRAP(CloseScreen);
|
|
||||||
WRAP(CreateGC);
|
WRAP(CreateGC);
|
||||||
WRAP(CopyWindow);
|
WRAP(CopyWindow);
|
||||||
WRAP(PaintWindow);
|
WRAP(PaintWindow);
|
||||||
|
|
Loading…
Reference in New Issue