--- rxvt-unicode/src/rxvtfont.C 2006/10/03 10:28:25 1.104 +++ rxvt-unicode/src/rxvtfont.C 2007/08/03 22:40:10 1.110 @@ -234,9 +234,9 @@ dTermDisplay; dTermGC; - if (color < 0 || color == Color_bg) + if (color == Color_bg || color == Color_transparent) XClearArea (disp, d, x, y, w, h, false); - else + else if (color >= 0) { #if XFT XftDrawRect (d, &term->pix_colors[color].c, x, y, w, h); @@ -443,7 +443,7 @@ ? f1 : (*fs)[fs->find_font (cc->c2)]; - f2->draw (d, x, y, chrs, width, fg, -1); + f2->draw (d, x, y, chrs, width, fg, Color_none); } } #endif @@ -1276,9 +1276,8 @@ bool buffered = bg >= 0 // we don't use a transparent bg #ifndef FORCE_UNBUFFERED_XFT -# if defined(XPM_BACKGROUND) || defined(TRANSPARENT) +# ifdef ENABLE_TRANSPARENCY || !term->am_transparent // we aren't transparent - || term->am_pixmap_trans // we have a pixmap # endif #endif ; @@ -1324,29 +1323,41 @@ if (0) ; -#ifdef TRANSPARENT - else if (bg < 0 && term->am_pixmap_trans) - XCopyArea (disp, term->pixmap, d2, gc, - x + term->window_vt_x, y + term->window_vt_y, - w, h, 0, 0); -#endif -#ifdef XPM_BACKGROUND +#ifdef HAVE_BG_PIXMAP else if (bg < 0 && term->bgPixmap.pixmap) { - XGCValues gcv; - - gcv.fill_style = FillTiled; - gcv.tile = term->pixmap; - gcv.ts_x_origin = -x; - gcv.ts_y_origin = -y; - - GC gc2 = XCreateGC (disp, d2, - GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle, - &gcv); + if (term->bgPixmap.pmap_width >= x + term->window_vt_x+w + && term->bgPixmap.pmap_height >= y + term->window_vt_y+h) + { + XCopyArea (disp, term->bgPixmap.pixmap, d2, gc, + x + term->window_vt_x, y + term->window_vt_y, + w, h, 0, 0); + } + else + { + XGCValues gcv; - XFillRectangle (disp, d2, gc2, 0, 0, w, h); + gcv.fill_style = FillTiled; + gcv.tile = term->bgPixmap.pixmap; + gcv.ts_x_origin = -x; + gcv.ts_y_origin = -y; - XFreeGC (disp, gc2); +#if 0 + GC gc2 = XCreateGC (disp, d2, + GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle, + &gcv); +#endif + XChangeGC (disp, gc, + GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle, + &gcv); + + XFillRectangle (disp, d2, gc/*gc2*/, 0, 0, w, h); + + gcv.fill_style = FillSolid; + XChangeGC (disp, gc, GCFillStyle, &gcv); + /* XFreeGC (disp, gc2); */ + + } } #endif else