X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=st.c;h=92854b4a3bac9e677554de2cb2c20e7e11722acb;hb=048c54fd5b275ac54d7819020485b77e99fcc469;hp=f2ee12f4b61b4f22255fcdfbb59547d8f08e774e;hpb=db6f796ecfafcee879613b60a772be3e5d9e355e;p=st.git diff --git a/st.c b/st.c index f2ee12f..92854b4 100644 --- a/st.c +++ b/st.c @@ -1410,7 +1410,7 @@ tsetchar(char *c, Glyph *attr, int x, int y) { void tclearregion(int x1, int y1, int x2, int y2) { - int x, y, temp; + int x, y, temp, mask; if(x1 > x2) temp = x1, x1 = x2, x2 = temp; @@ -1425,7 +1425,9 @@ tclearregion(int x1, int y1, int x2, int y2) { for(y = y1; y <= y2; y++) { term.dirty[y] = 1; for(x = x1; x <= x2; x++) { + mask = selected(x, y) ? ATTR_REVERSE : 0; term.line[y][x] = term.c.attr; + term.line[y][x].mode ^= mask; memcpy(term.line[y][x].c, " ", 2); } } @@ -2853,6 +2855,8 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) { /* Clean up the region we want to draw to. */ XftDrawRect(xw.draw, bg, winx, winy, width, xw.ch); + + /* Set the clip region because Xft is sometimes dirty. */ r.x = 0; r.y = 0; r.height = xw.ch;