diff options
author | Devin J. Pohly <djpohly@djpohly.com> | 2010-10-25 16:45:13 -0400 |
---|---|---|
committer | Devin J. Pohly <djpohly@djpohly.com> | 2010-10-25 16:45:13 -0400 |
commit | edfbc9b432bc779ec9c41f7523be52b99edeec85 (patch) | |
tree | f4211f187a7ebfc42d0d0dbb4c31301a11facb81 /st.c | |
parent | 638a30359d26c1f84a87f0f8df17df1765068029 (diff) | |
download | st-edfbc9b432bc779ec9c41f7523be52b99edeec85.tar.gz st-edfbc9b432bc779ec9c41f7523be52b99edeec85.zip |
redraw if we scroll on resize
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -170,7 +170,7 @@ static void tputtab(void); | |||
170 | static void tputc(char); | 170 | static void tputc(char); |
171 | static void tputs(char*, int); | 171 | static void tputs(char*, int); |
172 | static void treset(void); | 172 | static void treset(void); |
173 | static void tresize(int, int); | 173 | static int tresize(int, int); |
174 | static void tscrollup(int, int); | 174 | static void tscrollup(int, int); |
175 | static void tscrolldown(int, int); | 175 | static void tscrolldown(int, int); |
176 | static void tsetattr(int*, int); | 176 | static void tsetattr(int*, int); |
@@ -1202,7 +1202,7 @@ tputs(char *s, int len) { | |||
1202 | tputc(*s++); | 1202 | tputc(*s++); |
1203 | } | 1203 | } |
1204 | 1204 | ||
1205 | void | 1205 | int |
1206 | tresize(int col, int row) { | 1206 | tresize(int col, int row) { |
1207 | int i, x; | 1207 | int i, x; |
1208 | int minrow = MIN(row, term.row); | 1208 | int minrow = MIN(row, term.row); |
@@ -1210,7 +1210,7 @@ tresize(int col, int row) { | |||
1210 | int slide = term.c.y - row + 1; | 1210 | int slide = term.c.y - row + 1; |
1211 | 1211 | ||
1212 | if(col < 1 || row < 1) | 1212 | if(col < 1 || row < 1) |
1213 | return; | 1213 | return 0; |
1214 | 1214 | ||
1215 | /* free unneeded rows */ | 1215 | /* free unneeded rows */ |
1216 | i = 0; | 1216 | i = 0; |
@@ -1256,6 +1256,7 @@ tresize(int col, int row) { | |||
1256 | tmoveto(term.c.x, term.c.y); | 1256 | tmoveto(term.c.x, term.c.y); |
1257 | /* reset scrolling region */ | 1257 | /* reset scrolling region */ |
1258 | tsetscroll(0, row-1); | 1258 | tsetscroll(0, row-1); |
1259 | return (slide > 0); | ||
1259 | } | 1260 | } |
1260 | 1261 | ||
1261 | void | 1262 | void |
@@ -1650,7 +1651,8 @@ resize(XEvent *e) { | |||
1650 | row = (xw.h - 2*BORDER) / xw.ch; | 1651 | row = (xw.h - 2*BORDER) / xw.ch; |
1651 | if(col == term.col && row == term.row) | 1652 | if(col == term.col && row == term.row) |
1652 | return; | 1653 | return; |
1653 | tresize(col, row); | 1654 | if(tresize(col, row)) |
1655 | draw(SCREEN_REDRAW); | ||
1654 | ttyresize(col, row); | 1656 | ttyresize(col, row); |
1655 | xresize(col, row); | 1657 | xresize(col, row); |
1656 | } | 1658 | } |