From 6307ee77091041af2d34e93bc164352d4438a808 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Tue, 18 Sep 2007 18:22:44 +0200 Subject: [PATCH] GLX: allow skipping of visual init wrapping * GL/glx/glxvisuals.c: added boolean to disable calling init_visuals(). This gives a chance to Xephyr to take over visuals manipulation and avoid a crash at server shutdown in __glXMesaScreenDestroy(), due to the fact that mesa might sees more visual than what it has actually created in init_visuals(). It might see more visuals because Xephyr can augment the number of visuals, dynamically. * os/utils.c: the boolean is actually defined here. --- GL/glx/glxvisuals.c | 8 +++++--- os/utils.c | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/GL/glx/glxvisuals.c b/GL/glx/glxvisuals.c index 0e9bdedec..46b380b3d 100644 --- a/GL/glx/glxvisuals.c +++ b/GL/glx/glxvisuals.c @@ -55,6 +55,7 @@ void GlxWrapInitVisuals(miInitVisualsProcPtr *); +extern Bool noGlxVisualInit; #include "glcontextmodes.h" struct ScreenVisualsRec { @@ -452,14 +453,15 @@ Bool GlxInitVisuals(VisualPtr *visualp, DepthPtr *depthp, /* * Setup the visuals supported by this particular screen. */ - init_visuals(nvisualp, visualp, defaultVisp, - *ndepthp, *depthp, *rootDepthp); + if (!noGlxVisualInit) { + init_visuals(nvisualp, visualp, defaultVisp, + *ndepthp, *depthp, *rootDepthp); + } return True; } - /************************************************************************/ diff --git a/os/utils.c b/os/utils.c index 36c8dfeb3..31cb0af92 100644 --- a/os/utils.c +++ b/os/utils.c @@ -160,6 +160,7 @@ _X_EXPORT Bool noFontCacheExtension = FALSE; #endif #ifdef GLXEXT _X_EXPORT Bool noGlxExtension = FALSE; +_X_EXPORT Bool noGlxVisualInit = FALSE; #endif #ifdef SCREENSAVER _X_EXPORT Bool noScreenSaverExtension = FALSE;