--- rxvt-unicode/src/rxvtimg.C 2012/06/06 18:13:03 1.26 +++ rxvt-unicode/src/rxvtimg.C 2012/06/06 20:22:03 1.28 @@ -427,15 +427,30 @@ } rxvt_img * -rxvt_img::convert_to (XRenderPictFormat *new_format) +rxvt_img::convert_to (XRenderPictFormat *new_format, const rxvt_color &bg) { rxvt_img *img = new rxvt_img (s, new_format, w, h); Display *dpy = s->display->dpy; Picture src = XRenderCreatePicture (dpy, pm, format, 0, 0); Picture dst = XRenderCreatePicture (dpy, img->pm, new_format, 0, 0); + int op = PictOpSrc; - XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, w, h); + printf ("fa %x,%x fb %x,%x\n", format->direct.alpha, format->direct.alphaMask, new_format->direct.alpha, new_format->direct.alphaMask);//D + + if (format->direct.alpha && !new_format->direct.alpha) + { + // does it have to be that complicated + rgba c; + bg.get (c); + + XRenderColor rc = { c.r, c.g, c.b, 0xffff }; + XRenderFillRectangle (dpy, PictOpSrc, dst, &rc, 0, 0, w, h); + + op = PictOpOver; + } + + XRenderComposite (dpy, op, src, None, dst, 0, 0, 0, 0, 0, 0, w, h); XRenderFreePicture (dpy, src); XRenderFreePicture (dpy, dst);