miext: rootless: use PostCreateResources screen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so use the new PostCreateScreenResources screen hook instead. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
766f51e0c1
commit
88455524fe
|
@ -80,8 +80,6 @@ typedef struct _RootlessScreenRec {
|
|||
RootlessFrameProcsPtr imp;
|
||||
|
||||
// Wrapped screen functions
|
||||
CreateScreenResourcesProcPtr CreateScreenResources;
|
||||
|
||||
CreateWindowProcPtr CreateWindow;
|
||||
RealizeWindowProcPtr RealizeWindow;
|
||||
UnrealizeWindowProcPtr UnrealizeWindow;
|
||||
|
|
|
@ -111,31 +111,17 @@ RootlessUpdateScreenPixmap(ScreenPtr pScreen)
|
|||
* Rootless implementations typically set a null framebuffer pointer, which
|
||||
* causes problems with miCreateScreenResources. We fix things up here.
|
||||
*/
|
||||
static Bool
|
||||
RootlessCreateScreenResources(ScreenPtr pScreen)
|
||||
static void RootlessCreateScreenResources(CallbackListPtr *pcbl,
|
||||
ScreenPtr pScreen, Bool *ret)
|
||||
{
|
||||
Bool ret = TRUE;
|
||||
|
||||
SCREEN_UNWRAP(pScreen, CreateScreenResources);
|
||||
|
||||
if (pScreen->CreateScreenResources != NULL)
|
||||
ret = (*pScreen->CreateScreenResources) (pScreen);
|
||||
|
||||
SCREEN_WRAP(pScreen, CreateScreenResources);
|
||||
|
||||
if (!ret)
|
||||
return ret;
|
||||
|
||||
/* Make sure we have a valid screen pixmap. */
|
||||
|
||||
RootlessUpdateScreenPixmap(pScreen);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void RootlessCloseScreen(CallbackListPtr *pcbl, ScreenPtr pScreen, void *unused)
|
||||
{
|
||||
dixScreenUnhookClose(pScreen, RootlessCloseScreen);
|
||||
dixScreenUnhookPostCreateResources(pScreen, RootlessCreateScreenResources);
|
||||
|
||||
RootlessScreenRec *s = SCREENREC(pScreen);
|
||||
|
||||
|
@ -649,6 +635,7 @@ RootlessWrap(ScreenPtr pScreen)
|
|||
dixScreenHookClose(pScreen, RootlessCloseScreen);
|
||||
dixScreenHookWindowDestroy(pScreen, RootlessWindowDestroy);
|
||||
dixScreenHookWindowPosition(pScreen, RootlessWindowPosition);
|
||||
dixScreenHookPostCreateResources(pScreen, RootlessCreateScreenResources);
|
||||
|
||||
#define WRAP(a) \
|
||||
if (pScreen->a) { \
|
||||
|
@ -659,7 +646,6 @@ RootlessWrap(ScreenPtr pScreen)
|
|||
} \
|
||||
pScreen->a = Rootless##a
|
||||
|
||||
WRAP(CreateScreenResources);
|
||||
WRAP(CreateGC);
|
||||
WRAP(CopyWindow);
|
||||
WRAP(PaintWindow);
|
||||
|
|
Loading…
Reference in New Issue