[PATCH xserver 4/4] glx: Move Composite's synthetic visuals to a different select group
Adam Jackson
ajax at redhat.com
Thu Jan 19 22:23:59 UTC 2017
Should you find yourself using a 16bpp display while also using a
compositor, you poor soul, you may find that your GLX applications
behave strangely; in particular, glxgears will be transparent. This is
because it clears to (0,0,0,0) which is transparent if you honor alpha,
and it will choose the synthetic visual because it has the most
available r/g/b bits.
To avoid this, bump synthetic visuals to a higher (less-preferred)
select group. Unless the client explicitly asks for non-zero alpha bits,
this will prefer any rgb565 visual ahead of the argb8888 visual.
Signed-off-by: Adam Jackson <ajax at redhat.com>
---
glx/glxscreens.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 536c0c4..78e0aaf 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -43,6 +43,7 @@
#include "glxutil.h"
#include "glxext.h"
#include "protocol-versions.h"
+#include "compositeext.h"
static DevPrivateKeyRec glxScreenPrivateKeyRec;
@@ -336,6 +337,10 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen)
if (config) {
pGlxScreen->visuals[pGlxScreen->numVisuals++] = config;
config->visualID = visual->vid;
+#ifdef COMPOSITE
+ if (compIsAlternateVisual(pScreen, visual->vid))
+ config->visualSelectGroup++;
+#endif
}
}
--
2.9.3
More information about the xorg-devel
mailing list