@@ -539,6 +539,30 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
PixmapPtr pPixmap;
if (format == ZPixmap || depth == 1) {
+ if (depth == 24) { /* force the xRGB alpha channel to a sane value */
+ pixman_image_t *src, *dst;
+
+ src = pixman_image_create_bits (PIXMAN_x8r8g8b8,
+ w, h,
+ data,
+ PixmapBytePad(w, depth));
+ dst = pixman_image_create_bits (PIXMAN_a8r8g8b8,
+ w, h,
+ data,
+ PixmapBytePad(w, depth));
+ if (src != NULL && dst != NULL) {
+ pixman_image_composite (PIXMAN_OP_SRC,
+ src, NULL, dst,
+ 0, 0, 0, 0, 0, 0,
+ w, h);
+ }
+
+ if (src != NULL)
+ pixman_image_unref (src);
+ if (dst != NULL)
+ pixman_image_unref (dst);
+ }
+
pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth,
BitsPerPixel(depth),
PixmapBytePad(w, depth),