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