[dev] [st] [patch] Remove redundant xtermclear code

From: Ton van den Heuvel <tonvandenheuvel_AT_gmail.com>
Date: Wed, 2 Mar 2016 11:07:05 +0100

In case anything gets drawn in drawregion, xdrawglyphfontspecs ensures
that the region that needs to be drawn to is cleaned up. In case this
patch is not accepted; the current code contains an issue;

- xtermclear(0, y, term.col, y);
+ xtermclear(0, y, term.col-1, y);

Ton

diff --git a/st.c b/st.c
index 0536b6f..2473af7 100644
--- a/st.c
+++ b/st.c
_AT_@ -439,7 +439,6 @@ static void xresettitle(void);
 static void xsetpointermotion(int);
 static void xseturgency(int);
 static void xsetsel(char *, Time);
-static void xtermclear(int, int, int, int);
 static void xunloadfont(Font *);
 static void xunloadfonts(void);
 static void xresize(int, int);
_AT_@ -3213,17 +3212,6 @@ xsetcolorname(int x, const char *name)
     return 0;
 }

-void
-xtermclear(int col1, int row1, int col2, int row2)
-{
- XftDrawRect(xw.draw,
- &dc.col[IS_SET(MODE_REVERSE) ? defaultfg : defaultbg],
- borderpx + col1 * xw.cw,
- borderpx + row1 * xw.ch,
- (col2-col1+1) * xw.cw,
- (row2-row1+1) * xw.ch);
-}
-
 /*
  * Absolute coordinates.
  */
_AT_@ -3983,7 +3971,6 @@ drawregion(int x1, int y1, int x2, int y2)
         if (!term.dirty[y])
             continue;

- xtermclear(0, y, term.col, y);
         term.dirty[y] = 0;

         specs = term.specbuf;
Received on Wed Mar 02 2016 - 11:07:05 CET

This archive was generated by hypermail 2.3.0 : Wed Mar 02 2016 - 11:12:11 CET