merge.
authorAurélien Aptel <aurelien.aptel@gmail.com>
Tue, 1 Nov 2011 15:37:16 +0000 (16:37 +0100)
committerAurélien Aptel <aurelien.aptel@gmail.com>
Tue, 1 Nov 2011 15:37:16 +0000 (16:37 +0100)
1  2 
st.c

diff --combined st.c
--- 1/st.c
--- 2/st.c
+++ b/st.c
@@@ -463,9 -463,6 +463,9 @@@ bpress(XEvent *e) 
        if(IS_SET(MODE_MOUSE))
                mousereport(e);
        else if(e->xbutton.button == Button1) {
 +              if(sel.bx != -1)
 +                      for(int i=sel.b.y; i<=sel.e.y; i++)
 +                              term.dirty[i] = 1;
                sel.mode = 1;
                sel.ex = sel.bx = X2COL(e->xbutton.x);
                sel.ey = sel.by = Y2ROW(e->xbutton.y);
@@@ -586,7 -583,6 +586,7 @@@ brelease(XEvent *e) 
        else if(e->xbutton.button == Button1) {
                sel.mode = 0;
                getbuttoninfo(e, NULL, &sel.ex, &sel.ey);
 +              term.dirty[sel.ey] = 1;
                if(sel.bx == sel.ex && sel.by == sel.ey) {
                        struct timeval now;
                        sel.bx = -1;
@@@ -631,9 -627,7 +631,9 @@@ bmotion(XEvent *e) 
                if(oldey != sel.ey || oldex != sel.ex) {
                        int starty = MIN(oldey, sel.ey);
                        int endy = MAX(oldey, sel.ey);
 -                      drawregion(0, (starty > 0 ? starty : 0), term.col, (endy < term.row ? endy+1 : term.row));
 +                      for(int i=starty; i<=endy; i++)
 +                              term.dirty[i] = 1;
 +                      draw();
                }
        }
  }
@@@ -1861,7 -1855,7 +1861,7 @@@ drawregion(int x1, int y1, int x2, int 
                        xdraws(buf, base, ox, y, ic, ib);
        }
        xdrawcursor();
-       XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, 0, 0, xw.bufw, xw.bufh, BORDER, BORDER);
 -      XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, x1*xw.cw, y1*xw.ch, (x2-1)*xw.cw, (y2-1)*xw.ch, BORDER, BORDER);
++      XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, x1*xw.cw, y1*xw.ch, x2*xw.cw, y2*xw.ch, BORDER, BORDER);
  }
  
  void