diff options
author | Christoph Lohmann <20h@r-36.net> | 2012-09-17 22:44:27 +0200 |
---|---|---|
committer | Christoph Lohmann <20h@r-36.net> | 2012-09-17 22:44:27 +0200 |
commit | e4bf2679c1bbbd4d4a8bfdf9c1a143b59ce5888c (patch) | |
tree | ccfaed60c0a7ad755eec4337fbe268a0a8a19f05 | |
parent | 4876d6e05b6c1b17b0c366f15ae72ae48f045068 (diff) | |
download | st-e4bf2679c1bbbd4d4a8bfdf9c1a143b59ce5888c.tar.gz st-e4bf2679c1bbbd4d4a8bfdf9c1a143b59ce5888c.zip |
Fixing the redrawing patch of k0ga, so it's using xclear() in redraw() too.
-rw-r--r-- | st.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -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 | ||
1838 | void | 1839 | void |
1839 | xresize(int col, int row) { | 1840 | xresize(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 | ||
1847 | void | 1845 | void |
@@ -2145,6 +2143,8 @@ xresettitle(void) { | |||
2145 | void | 2143 | void |
2146 | redraw(void) { | 2144 | redraw(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); |