Make sure the depth of the corresponding match for the fbconfig we pick.

From: Kristian Høgsberg <krh@redhat.com>


---

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

diff --git a/src/screen.c b/src/screen.c
index 9ec30d5..75c6abc 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -1309,6 +1309,18 @@ addScreen (CompDisplay *display,
 
 	for (j = 0; j < nElements; j++)
 	{
+	    {
+	      XVisualInfo *vi;
+	      int visual_depth;
+	      vi = glXGetVisualFromFBConfig(dpy, fbConfigs[j]);
+	      if (vi == NULL)
+		continue;
+	      visual_depth = vi->depth;
+	      XFree(vi);
+	      if (visual_depth != i)
+		continue;
+	    }
+
 	    (*s->getFBConfigAttrib) (dpy,
 				     fbConfigs[j],
 				     GLX_ALPHA_SIZE,
