mi: 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
56aad1434b
commit
c927d13ed8
|
@ -30,6 +30,8 @@
|
|||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "dix/screen_hooks_priv.h"
|
||||
|
||||
#include <GL/glxtokens.h>
|
||||
#include <string.h>
|
||||
#include <windowstr.h>
|
||||
|
@ -157,16 +159,11 @@ static const char GLServerExtensions[] =
|
|||
"GL_SGIX_shadow_ambient "
|
||||
"GL_SUN_slice_accum ";
|
||||
|
||||
static Bool
|
||||
glxCloseScreen(ScreenPtr pScreen)
|
||||
static void glxCloseScreen(CallbackListPtr *pcbl, ScreenPtr pScreen, void *unused)
|
||||
{
|
||||
__GLXscreen *pGlxScreen = glxGetScreen(pScreen);
|
||||
|
||||
pScreen->CloseScreen = pGlxScreen->CloseScreen;
|
||||
|
||||
dixScreenUnhookClose(pScreen, glxCloseScreen);
|
||||
pGlxScreen->destroy(pGlxScreen);
|
||||
|
||||
return pScreen->CloseScreen(pScreen);
|
||||
}
|
||||
|
||||
__GLXscreen *
|
||||
|
@ -327,8 +324,7 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen)
|
|||
pGlxScreen->GLextensions = strdup(GLServerExtensions);
|
||||
pGlxScreen->GLXextensions = NULL;
|
||||
|
||||
pGlxScreen->CloseScreen = pScreen->CloseScreen;
|
||||
pScreen->CloseScreen = glxCloseScreen;
|
||||
dixScreenHookClose(pScreen, glxCloseScreen);
|
||||
|
||||
i = 0;
|
||||
for (m = pGlxScreen->fbconfigs; m != NULL; m = m->next) {
|
||||
|
|
|
@ -149,8 +149,6 @@ struct __GLXscreen {
|
|||
char *GLXextensions;
|
||||
char *glvnd;
|
||||
unsigned char glx_enable_bits[__GLX_EXT_BYTES];
|
||||
|
||||
Bool (*CloseScreen) (ScreenPtr pScreen);
|
||||
};
|
||||
|
||||
void __glXScreenInit(__GLXscreen * screen, ScreenPtr pScreen);
|
||||
|
|
Loading…
Reference in New Issue