From nobody Mon Sep 17 00:00:00 2001
From: Kristian Høgsberg <krh@redhat.com>
Date: Wed, 14 Jun 2006 01:37:41 -0400
Subject: [PATCH] Only select fbconfig where the corresponding visual depth matches.

---

 src/screen.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

fc5fd4bd4680f91cedf27bdbff81b039aa1e4bd7
diff --git a/src/screen.c b/src/screen.c
index 47ee728..061211a 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -1318,6 +1318,16 @@ addScreen (CompDisplay *display,
 
 	for (j = 0; j < nElements; j++)
 	{
+	    {
+	      XVisualInfo *vi;
+	      int visual_depth;
+	      vi = glXGetVisualFromFBConfig(dpy, fbConfigs[j]);
+	      visual_depth = vi->depth;
+	      XFree(vi);
+	      if (visual_depth != i)
+		continue;
+	    }
+
 	    (*s->getFBConfigAttrib) (dpy,
 				     fbConfigs[j],
 				     GLX_ALPHA_SIZE,
-- 
1.3.3

