summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuxuan Shui <yshuiv7@gmail.com>2018-06-24 12:45:08 -0500
committerSlávek Banko <slavek.banko@axis.cz>2018-06-24 19:55:09 +0200
commit1689b333008e31d1d7df0a855090e66d6a9a495e (patch)
tree6b2fd9c32a1aedab851139d37effc6f4c2fae6cd
parentbc08650da1a29f4178fa2f412b18474fbf6727fb (diff)
downloadtdebase-1689b333008e31d1d7df0a855090e66d6a9a495e.tar.gz
tdebase-1689b333008e31d1d7df0a855090e66d6a9a495e.zip
Avoid using 10bit FBConfigs
Fix weird color issue with Mesa 18.0 (cherry picked from commit a94535c16eb309fdd23648511e0f552fccaf7173)
-rw-r--r--twin/compton-tde/opengl.c10
1 files changed, 10 insertions, 0 deletions
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; }