summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2009-11-07 19:32:33 +0000
committerJon TURNEY <jon.turney@dronecode.org.uk>2010-08-13 15:15:26 +0100
commit948070362c205e9c79cb462c8e3782bb09632b26 (patch)
tree7e97e642e78cb972da40feac4a1c0acb59af3c05
parentaa74cf8a7459cc9305246bc650eef101533e2904 (diff)
Do not create visuals from fbConfigs which don't support window drawables.
It is implicit that visuals are suitable for use with a window. Glean (for e.g.) assumes all visuals support window drawables. glXChooseVisual() documentation also says: "There is no direct filter for picking only visuals that support GLXPixmaps. GLXPixmaps are supported for visuals whose GLX_BUFFER_SIZE is one of the pixmap depths supported by the X server." This appears to perhaps mean that we should also only create visuals from fbConfigs which have a GLX_BUFFER_SIZE which is one of the Pixmap depths supported by the X server if drawableType contains GLX_PIXMAP_BIT. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
-rw-r--r--glx/glxscreens.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 8515e14d5..353c798d3 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -425,6 +425,10 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
if (i == pScreen->numVisuals)
continue;
+ /* Make sure the FBconfig supports window drawables */
+ if (!(config->drawableType & GLX_WINDOW_BIT))
+ continue;
+
/* Create a new X visual for our FBconfig. */
visual = AddScreenVisuals(pScreen, 1, depth);
if (visual == NULL)