aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2012-09-17 22:44:27 +0200
committerChristoph Lohmann <20h@r-36.net>2012-09-17 22:44:27 +0200
commite4bf2679c1bbbd4d4a8bfdf9c1a143b59ce5888c (patch)
treeccfaed60c0a7ad755eec4337fbe268a0a8a19f05
parent4876d6e05b6c1b17b0c366f15ae72ae48f045068 (diff)
downloadst-e4bf2679c1bbbd4d4a8bfdf9c1a143b59ce5888c.tar.gz
st-e4bf2679c1bbbd4d4a8bfdf9c1a143b59ce5888c.zip
Fixing the redrawing patch of k0ga, so it's using xclear() in redraw() too.
-rw-r--r--st.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/st.c b/st.c
index 20e4512..89c59b4 100644
--- a/st.c
+++ b/st.c
@@ -198,6 +198,7 @@ typedef struct {
198 int scr; 198 int scr;
199 Bool isfixed; /* is fixed geometry? */ 199 Bool isfixed; /* is fixed geometry? */
200 int fx, fy, fw, fh; /* fixed geometry */ 200 int fx, fy, fw, fh; /* fixed geometry */
201 int tw, th; /* tty width and height */
201 int w; /* window width */ 202 int w; /* window width */
202 int h; /* window height */ 203 int h; /* window height */
203 int ch; /* char height */ 204 int ch; /* char height */
@@ -894,8 +895,8 @@ ttyresize(int x, int y) {
894 895
895 w.ws_row = term.row; 896 w.ws_row = term.row;
896 w.ws_col = term.col; 897 w.ws_col = term.col;
897 w.ws_xpixel = xw.w; 898 w.ws_xpixel = xw.tw;
898 w.ws_ypixel = xw.h; 899 w.ws_ypixel = xw.th;
899 if(ioctl(cmdfd, TIOCSWINSZ, &w) < 0) 900 if(ioctl(cmdfd, TIOCSWINSZ, &w) < 0)
900 fprintf(stderr, "Couldn't set window size: %s\n", SERRNO); 901 fprintf(stderr, "Couldn't set window size: %s\n", SERRNO);
901} 902}
@@ -1837,11 +1838,8 @@ tresize(int col, int row) {
1837 1838
1838void 1839void
1839xresize(int col, int row) { 1840xresize(int col, int row) {
1840 xw.w = MAX(1, 2*BORDER + col * xw.cw); 1841 xw.tw = MAX(1, 2*BORDER + col * xw.cw);
1841 xw.h = MAX(1, 2*BORDER + row * xw.ch); 1842 xw.th = MAX(1, 2*BORDER + row * xw.ch);
1842 XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0,
1843 DisplayWidth(xw.dpy, xw.scr),
1844 DisplayHeight(xw.dpy, xw.scr));
1845} 1843}
1846 1844
1847void 1845void
@@ -2145,6 +2143,8 @@ xresettitle(void) {
2145void 2143void
2146redraw(void) { 2144redraw(void) {
2147 struct timespec tv = {0, REDRAW_TIMEOUT * 1000}; 2145 struct timespec tv = {0, REDRAW_TIMEOUT * 1000};
2146
2147 xclear(0, 0, xw.w, xw.h);
2148 tfulldirt(); 2148 tfulldirt();
2149 draw(); 2149 draw();
2150 XSync(xw.dpy, False); /* necessary for a good tput flash */ 2150 XSync(xw.dpy, False); /* necessary for a good tput flash */
@@ -2334,6 +2334,8 @@ resize(XEvent *e) {
2334 row = (xw.h - 2*BORDER) / xw.ch; 2334 row = (xw.h - 2*BORDER) / xw.ch;
2335 if(col == term.col && row == term.row) 2335 if(col == term.col && row == term.row)
2336 return; 2336 return;
2337
2338 xclear(0, 0, xw.w, xw.h);
2337 tresize(col, row); 2339 tresize(col, row);
2338 xresize(col, row); 2340 xresize(col, row);
2339 ttyresize(col, row); 2341 ttyresize(col, row);