--- rxvt-unicode/src/rxvtfont.C 2007/08/03 22:40:10 1.110 +++ rxvt-unicode/src/rxvtfont.C 2007/08/17 22:01:33 1.111 @@ -1274,14 +1274,15 @@ int w = term->fwidth * len; int h = term->fheight; - bool buffered = bg >= 0 // we don't use a transparent bg -#ifndef FORCE_UNBUFFERED_XFT -# ifdef ENABLE_TRANSPARENCY - || !term->am_transparent // we aren't transparent -# endif + /* TODO: this logic needs some more thinking, since we no longer do pseudo-transparency. + * Maybe make buffering into a resource flag? Compile time option doesn't seems like a + * good idea from the perspective of packaging for wide variety of user configs. + */ + bool buffered = true +#ifdef FORCE_UNBUFFERED_XFT + && bg >= 0 #endif ; - // cut trailing spaces while (len && text [len - 1] == ' ') len--; @@ -1320,11 +1321,10 @@ if (ep != enc) { rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); + bool back_rendered = false; - if (0) - ; #ifdef HAVE_BG_PIXMAP - else if (bg < 0 && term->bgPixmap.pixmap) + if (term->bgPixmap.pixmap && (bg < 0 || term->pix_colors[bg].c.color.alpha < 0x0ff00)) { if (term->bgPixmap.pmap_width >= x + term->window_vt_x+w && term->bgPixmap.pmap_height >= y + term->window_vt_y+h) @@ -1356,11 +1356,22 @@ gcv.fill_style = FillSolid; XChangeGC (disp, gc, GCFillStyle, &gcv); /* XFreeGC (disp, gc2); */ - + } + if (bg > 0) + { + Picture dst = XftDrawPicture(d2); + if (dst != 0) + { + Picture solid_color_pict = XftDrawSrcPicture (d2, &term->pix_colors[bg].c); + XRenderComposite (disp, PictOpOver, solid_color_pict, None, dst, 0, 0, 0, 0, 0, 0, w, h); + } + } + back_rendered = true; } #endif - else + + if(bg > 0 && !back_rendered) XftDrawRect (d2, &term->pix_colors[bg].c, 0, 0, w, h); XftDrawGlyphSpec (d2, &term->pix_colors[fg].c, f, enc, ep - enc);