From a94535c16eb309fdd23648511e0f552fccaf7173 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sun, 24 Jun 2018 12:45:08 -0500 Subject: Avoid using 10bit FBConfigs Fix weird color issue with Mesa 18.0 --- twin/compton-tde/opengl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'twin') diff --git a/twin/compton-tde/opengl.c b/twin/compton-tde/opengl.c index 4cbfeb455..f30f43c31 100644 --- a/twin/compton-tde/opengl.c +++ b/twin/compton-tde/opengl.c @@ -811,6 +811,16 @@ glx_cmp_fbconfig(session_t *ps, return -1; if (!pfbc_b) return 1; + int tmpattr; + + // Avoid 10-bit colors + glXGetFBConfigAttrib(ps->dpy, pfbc_a->cfg, GLX_RED_SIZE, &tmpattr); + if (tmpattr != 8) + return -1; + + glXGetFBConfigAttrib(ps->dpy, pfbc_b->cfg, GLX_RED_SIZE, &tmpattr); + if (tmpattr != 8) + return 1; #define P_CMPATTR_LT(attr) { if ((result = glx_cmp_fbconfig_cmpattr(ps, pfbc_a, pfbc_b, (attr)))) return -result; } #define P_CMPATTR_GT(attr) { if ((result = glx_cmp_fbconfig_cmpattr(ps, pfbc_a, pfbc_b, (attr)))) return result; } -- cgit v1.2.1