JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Fixing the selection issue in altscreens.
[st.git] / st.c
diff --git a/st.c b/st.c
index f2ee12f..c0a4780 100644 (file)
--- a/st.c
+++ b/st.c
@@ -1425,6 +1425,8 @@ 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++) {
+                       if(selected(x, y))
+                               selclear(NULL);
                        term.line[y][x] = term.c.attr;
                        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;
@@ -3092,7 +3096,7 @@ drawregion(int x1, int y1, int x2, int y2) {
                ic = ib = ox = 0;
                for(x = x1; x < x2; x++) {
                        new = term.line[y][x];
-                       if(ena_sel && *(new.c) && selected(x, y))
+                       if(ena_sel && selected(x, y))
                                new.mode ^= ATTR_REVERSE;
                        if(ib > 0 && (ATTRCMP(base, new)
                                        || ib >= DRAW_BUF_SIZ-UTF_SIZ)) {