--- rxvt-unicode/src/rxvtfont.C 2008/01/23 05:18:43 1.129 +++ rxvt-unicode/src/rxvtfont.C 2008/01/23 06:49:30 1.133 @@ -239,10 +239,12 @@ { #if XFT bool done = false; -#ifdef HAVE_BG_PIXMAP - if (term->bgPixmap.pixmap && color >= 0 && term->pix_colors[color].c.color.alpha < 0x0ff00) + +# ifdef HAVE_BG_PIXMAP + if (term->bgPixmap.pixmap && color >= 0 && !term->pix_colors[color].is_opaque ()) { Picture dst = XftDrawPicture (d); + if (dst != 0) { XClearArea (disp, d, x, y, w, h, false); @@ -251,9 +253,10 @@ done = true; } } -#endif +# endif if (!done) XftDrawRect (d, &term->pix_colors[color].c, x, y, w, h); + #else XSetForeground (disp, gc, term->pix_colors[color]); XFillRectangle (disp, d, gc, x, y, w, h); @@ -1302,7 +1305,7 @@ * 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 = bg >= 0; + bool buffered = bg >= Color_transparent; #ifdef FORCE_UNBUFFERED_XFT buffered = false; #endif @@ -1352,12 +1355,14 @@ { Picture dst = 0; - if (bg >= 0 && term->pix_colors[bg].c.color.alpha < 0xff00) + if (bg >= 0 && term->pix_colors[bg].is_opaque ()) + XftDrawRect (d2, &term->pix_colors[bg].c, 0, 0, w, h); + else dst = XftDrawPicture (d2); - if (bg < 0 || dst != 0) + if (dst) { - int src_x = x, src_y = y ; + int src_x = x, src_y = y; if (term->bgPixmap.is_parentOrigin ()) { @@ -1390,8 +1395,11 @@ XChangeGC (disp, gc, GCFillStyle, &gcv); } - 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); + if (bg >= 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; } @@ -1399,7 +1407,7 @@ #endif if (!back_rendered) - XftDrawRect (d2, &term->pix_colors[bg].c, 0, 0, w, h); + XftDrawRect (d2, &term->pix_colors[bg < 0 ? Color_bg : bg].c, 0, 0, w, h); XftDrawGlyphSpec (d2, &term->pix_colors[fg].c, f, enc, ep - enc); XCopyArea (disp, d2, d, gc, 0, 0, w, h, x, y);