From 92de0d9ecccd639cec36003ce6d4f818650ccb14 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 27 Jun 2008 00:44:32 +0000 Subject: [PATCH] refactoring --- Changes | 2 ++ src/screen.C | 27 +++++++++++---------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/Changes b/Changes index ee61ffcb..f09ffd41 100644 --- a/Changes +++ b/Changes @@ -19,6 +19,8 @@ WISH: load system-wide config file even if we don't have one WISH: look into XAddConnectionWatch, does anybody need that? DUMB: support tex fonts +TODO: /*TODO: the xlceararea/xfillrectangle below don't take scroll offste into account, ask mikachu for details */ + 9.05 Sun Jun 15 20:09:20 CEST 2008 - new option --cd/chdir to set the starting working directory. - tabbed extension now starts in the "correct" working directory. diff --git a/src/screen.C b/src/screen.C index 4e0f21d1..49e93386 100644 --- a/src/screen.C +++ b/src/screen.C @@ -85,28 +85,14 @@ static inline void fill_text (text_t *start, text_t value, int len) ROW_AND_COL_IN_ROW_AT_OR_BEFORE ((X).row, (X).col, (Y).row, (Y).col) /* - * CLEAR_ROWS : clear rows starting from row * CLEAR_CHARS: clear chars starting from pixel position - * ERASE_ROWS : set rows starting from row to the foreground colour */ -#define CLEAR_ROWS(row, num) \ - if (mapped) \ - XClearArea (dpy, vt, 0, \ - Row2Pixel (row), (unsigned int)width, \ - (unsigned int)Height2Pixel (num), False) - #define CLEAR_CHARS(x, y, num) \ if (mapped) \ XClearArea (dpy, vt, x, y, \ (unsigned int)Width2Pixel (num), \ (unsigned int)Height2Pixel (1), False) -#define ERASE_ROWS(row, num) \ - XFillRectangle (dpy, vt, gc, \ - 0, Row2Pixel (row), \ - (unsigned int)width, \ - (unsigned int)Height2Pixel (num)) - /* ------------------------------------------------------------------------- * * SCREEN `COMMON' ROUTINES * * ------------------------------------------------------------------------- */ @@ -1338,19 +1324,28 @@ rxvt_term::scr_erase_screen (int mode) NOTHROW min_it (num, nrow - row); + /*TODO: the xlceararea/xfillrectangle below don't take scroll offste into account, ask mikachu for details */ if (rstyle & (RS_RVid | RS_Uline)) ren = (rend_t) ~RS_None; else if (GET_BASEBG (rstyle) == Color_bg) { ren = DEFAULT_RSTYLE; - CLEAR_ROWS (row, num); + + if (mapped) + XClearArea (dpy, vt, 0, + Row2Pixel (row), (unsigned int)width, + (unsigned int)Height2Pixel (num), False); } else { ren = rstyle & (RS_fgMask | RS_bgMask); + gcvalue.foreground = pix_colors[bgcolor_of (rstyle)]; XChangeGC (dpy, gc, GCForeground, &gcvalue); - ERASE_ROWS (row, num); + XFillRectangle (dpy, vt, gc, + 0, Row2Pixel (row), + (unsigned int)width, + (unsigned int)Height2Pixel (num)); gcvalue.foreground = pix_colors[Color_fg]; XChangeGC (dpy, gc, GCForeground, &gcvalue); } -- 2.34.1