--- rxvt-unicode/src/screen.C 2004/02/22 08:09:38 1.31 +++ rxvt-unicode/src/screen.C 2004/02/24 00:44:23 1.34 @@ -2171,7 +2171,7 @@ rxvt_font *font = (*TermWin.fontset)[fid]; if (back == fore) - font->clear_rect (xpixel, ypixel, + font->clear_rect (*TermWin.drawable, xpixel, ypixel, TermWin.fwidth * count, TermWin.fheight, back); else if (back == Color_bg) @@ -2183,15 +2183,15 @@ for (i = 0; i < count; i++) /* don't draw empty strings */ if (text[i] != ' ') { - font->draw (xpixel, ypixel, text, count, fore, -1); + font->draw (*TermWin.drawable, xpixel, ypixel, text, count, fore, -1); break; } } else - font->draw (xpixel, ypixel, text, count, fore, Color_bg); + font->draw (*TermWin.drawable, xpixel, ypixel, text, count, fore, Color_bg); } else - font->draw (xpixel, ypixel, text, count, fore, back); + font->draw (*TermWin.drawable, xpixel, ypixel, text, count, fore, back); if ((rend & RS_Uline) && (font->descent > 1)) XDrawLine (display->display, drawBuffer, TermWin.gc, @@ -2262,6 +2262,29 @@ want_refresh = 0; /* screen is current */ } +void +rxvt_term::scr_remap_chars (text_t *tp, rend_t *rp) +{ + if (!rp || !tp) + return; + + for (int i = TermWin.ncol; i; i--, rp++, tp++) + *rp = SET_FONT (*rp, TermWin.fontset->find_font (*tp)); +} + +void +rxvt_term::scr_remap_chars () +{ + for (int i = TermWin.nrow + TermWin.saveLines; i--; ) + scr_remap_chars (screen.text[i], screen.rend[i]); + + for (int i = TermWin.nrow; i--; ) + { + scr_remap_chars (drawn_text[i], drawn_rend[i]); + scr_remap_chars (swap.text[i], swap.rend[i]); + } +} + /* ------------------------------------------------------------------------- */ void rxvt_term::scr_clear () @@ -2669,8 +2692,7 @@ D_SELECT ((stderr, "rxvt_selection_clear ()")); want_refresh = 1; - if (selection.text) - free (selection.text); + free (selection.text); selection.text = NULL; selection.len = 0; CLEAR_SELECTION ();