summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2017-01-19 17:20:49 -0500
committerAdam Jackson <ajax@redhat.com>2017-01-25 11:27:33 -0500
commitea483af99a6351323afe00a0b630cd63310efdb1 (patch)
treeb976505df3dc96e65e3ca01d97d139dc606ee2af
parent43efaa6e4fd903229dc9c508da4177ad4bbdd4d8 (diff)
glx: Move Composite's synthetic visuals to a different select group
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. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--glx/glxscreens.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 536c0c495..78e0aaff9 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
}
}