Fix colors with mesa 18 by disabling 10bits fbconfigs.

Patch from https://github.com/yshui/compton/commit/bf29b2d.
Hint from thfr@, ok Sunil Nimmagadda (maintainer), thfr@
This commit is contained in:
matthieu 2019-02-13 20:36:08 +00:00
parent a6f6099907
commit 1252fec29b
2 changed files with 27 additions and 2 deletions

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.5 2018/06/27 21:04:07 espie Exp $
# $OpenBSD: Makefile,v 1.6 2019/02/13 20:36:08 matthieu Exp $
COMMENT = lightweight compositor for X, forked from xcompmgr-dana
V = 0.1_beta2
PKGNAME = compton-${V}
DISTNAME = compton-git-v0.1_beta2-2013-10-21
REVISION = 2
REVISION = 3
CATEGORIES = x11

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-src_opengl_c,v 1.1 2019/02/13 20:36:08 matthieu Exp $
https://github.com/yshui/compton/commit/bf29b2d
Avoid using 10bit FBConfigs
Fix weird color issue with Mesa 18.0
--- src/opengl.c.orig Mon Oct 21 16:17:01 2013
+++ src/opengl.c Tue Feb 12 21:14:44 2019
@@ -497,6 +497,16 @@
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; }