diff -r 5b6474453e77 st.c --- a/st.c Tue Apr 27 00:04:29 2010 +0200 +++ b/st.c Mon May 31 22:23:36 2010 +0100 @@ -1242,16 +1242,17 @@ void resize(XEvent *e) { int col, row; - col = e->xconfigure.width / xw.cw; - row = e->xconfigure.height / xw.ch; + col = (e->xconfigure.width - 2*BORDER) / xw.cw; + row = (e->xconfigure.height - 2*BORDER) / xw.ch; if(term.col != col || term.row != row) { tresize(col, row); ttyresize(col, row); - xw.w = e->xconfigure.width; - xw.h = e->xconfigure.height; + xw.w = e->xconfigure.width - 2*BORDER; + xw.h = e->xconfigure.height - 2*BORDER; XFreePixmap(xw.dis, xw.buf); xw.buf = XCreatePixmap(xw.dis, xw.win, xw.w, xw.h, XDefaultDepth(xw.dis, xw.scr)); + XFillRectangle(xw.dis, xw.buf, dc.gc, 0, 0, xw.w, xw.h); draw(SCREEN_REDRAW); } }