aboutsummaryrefslogtreecommitdiff
path: root/xorg-server
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-07 08:25:39 +0000
committermarha <marha@users.sourceforge.net>2011-03-07 08:25:39 +0000
commitbba08fdb8faad9f65b3ea2133676b9f6263aef37 (patch)
treea55db1a6e07aef779c97ea8b305318567ab7d43d /xorg-server
parent182e102aa795542b106798b22d2f2dcd84440622 (diff)
downloadvcxsrv-bba08fdb8faad9f65b3ea2133676b9f6263aef37.tar.gz
vcxsrv-bba08fdb8faad9f65b3ea2133676b9f6263aef37.tar.bz2
vcxsrv-bba08fdb8faad9f65b3ea2133676b9f6263aef37.zip
Handle failure to get any fbconfigs more gracefully
Diffstat (limited to 'xorg-server')
-rw-r--r--xorg-server/hw/xwin/glx/indirect.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/xorg-server/hw/xwin/glx/indirect.c b/xorg-server/hw/xwin/glx/indirect.c
index 9660dc151..4367d6990 100644
--- a/xorg-server/hw/xwin/glx/indirect.c
+++ b/xorg-server/hw/xwin/glx/indirect.c
@@ -717,17 +717,37 @@ glxWinScreenProbe(ScreenPtr pScreen)
screen->base.swapInterval = glxWinScreenSwapInterval;
screen->base.pScreen = pScreen;
+ // Creating the fbConfigs initializes screen->base.fbconfigs and screen->base.numFBConfigs
if (strstr(wgl_extensions, "WGL_ARB_pixel_format"))
{
glxWinCreateConfigsExt(hdc, screen);
- screen->has_WGL_ARB_pixel_format = TRUE;
+
+ /*
+ Some graphics drivers appear to advertise WGL_ARB_pixel_format,
+ but it doesn't work usefully, so we have to be prepared for it
+ to fail and fall back to using DescribePixelFormat()
+ */
+ if (screen->base.numFBConfigs > 0)
+ {
+ screen->has_WGL_ARB_pixel_format = TRUE;
+ }
}
- else
+
+ if (screen->base.numFBConfigs <= 0)
{
glxWinCreateConfigs(hdc, screen);
screen->has_WGL_ARB_pixel_format = FALSE;
}
- // Initializes screen->base.fbconfigs and screen->base.numFBConfigs
+
+ /*
+ If we still didn't get any fbConfigs, we can't provide GLX for this screen
+ */
+ if (screen->base.numFBConfigs <= 0)
+ {
+ free(screen);
+ LogMessage(X_ERROR,"AIGLX: No fbConfigs could be made from native OpenGL pixel formats\n");
+ return NULL;
+ }
/* These will be set by __glXScreenInit */
screen->base.visuals = NULL;