summaryrefslogtreecommitdiffstats
path: root/video/out/gl_x11.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-02-06 14:12:04 +0100
committerwm4 <wm4@nowhere>2014-02-06 14:12:04 +0100
commit7134574f5304e20a83645b123cf70610344597e4 (patch)
tree9c1cbdf4c1be326e1734d184437070cfb326967e /video/out/gl_x11.c
parent41a5837e2b2b0daa772acbfc6656900c8a242dad (diff)
downloadmpv-7134574f5304e20a83645b123cf70610344597e4.tar.bz2
mpv-7134574f5304e20a83645b123cf70610344597e4.tar.xz
gl_x11: always request true color visual
This fixes issue #504. For some reason, glXChooseFBConfig() will return a fbconfig with no associated visual. (I'm not sure if this allowed. They don't always have a visual, but since GLX_X_RENDERABLE is set and GLX_DRAWABLE_TYPE is (implicitly) set to GLX_WINDOW_BIT, why would there be no visual?) Even worse, a test program seems to show that a 16 bit fbconfig is selected (instead of 24/32 bit), which doesn't sound nice at all. Since there _are_ better fbconfigs available, glXChooseFBConfig() should normally sort them by quality, and return the better ones first. It's worth noting that this function should also prefer GLX_TRUE_COLOR over anything else, although this comes last in the sort order. Whatever is going on, requesting GLX_X_VISUAL_TYPE with GLX_TRUE_COLOR seems to fix it.
Diffstat (limited to 'video/out/gl_x11.c')
-rw-r--r--video/out/gl_x11.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/video/out/gl_x11.c b/video/out/gl_x11.c
index 434d0d8b3d..d6191de1de 100644
--- a/video/out/gl_x11.c
+++ b/video/out/gl_x11.c
@@ -218,6 +218,7 @@ static bool config_window_x11(struct MPGLContext *ctx, uint32_t d_width,
int glx_attribs[] = {
GLX_STEREO, False,
GLX_X_RENDERABLE, True,
+ GLX_X_VISUAL_TYPE, GLX_TRUE_COLOR,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,