From 72f1dc239dc76f323288304aa902c97f343fca9e Mon Sep 17 00:00:00 2001
From: Roderick Colenbrander <thunderbird2k@gmail.com>
Date: Fri, 31 Jul 2009 22:50:36 +0200
Subject: [PATCH] We should not expect that the default visual supports GLX. This caused some issues by XQuartz which they fixed but nonetheless we are violating the GLX standard, so use glXChooseVisual instead.

---
 dlls/winex11.drv/opengl.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index b2cf82a..4e4a3a0 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -275,15 +275,12 @@ MAKE_FUNCPTR(glFlush)
 static BOOL infoInitialized = FALSE;
 static BOOL X11DRV_WineGL_InitOpenglInfo(void)
 {
-
     int screen = DefaultScreen(gdi_display);
     Window win = RootWindow(gdi_display, screen);
     const char* str;
-    Visual *visual;
-    XVisualInfo template;
     XVisualInfo *vis;
-    int num;
     GLXContext ctx = NULL;
+    int attribList[] = {GLX_RGBA, GLX_DOUBLEBUFFER, None};
 
     if (infoInitialized)
         return TRUE;
@@ -291,9 +288,7 @@ static BOOL X11DRV_WineGL_InitOpenglInfo(void)
 
     wine_tsx11_lock();
 
-    visual = DefaultVisual(gdi_display, screen);
-    template.visualid = XVisualIDFromVisual(visual);
-    vis = XGetVisualInfo(gdi_display, VisualIDMask, &template, &num);
+    vis = pglXChooseVisual(gdi_display, screen, attribList);
     if (vis) {
         WORD old_fs = wine_get_fs();
         /* Create a GLX Context. Without one we can't query GL information */
-- 
1.6.0.4

