diff options
author | Devin J. Pohly <djpohly@gmail.com> | 2017-10-10 15:51:23 -0500 |
---|---|---|
committer | Devin J. Pohly <djpohly@gmail.com> | 2018-02-25 21:53:24 -0600 |
commit | dbe8676d7d69651132bde2b6d9ec3787cbbc552a (patch) | |
tree | 06b6397a18b266085f5b89677521dd441c860b4f | |
parent | a8314643b1aeaa2187dad71dc5748aaac1760c1b (diff) | |
download | st-patched-dbe8676d7d69651132bde2b6d9ec3787cbbc552a.tar.bz2 st-patched-dbe8676d7d69651132bde2b6d9ec3787cbbc552a.tar.xz st-patched-dbe8676d7d69651132bde2b6d9ec3787cbbc552a.zip |
Pass new dimensions into ttyresize
This removes another reference to TermWindow from st.c.
Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
-rw-r--r-- | st.c | 6 | ||||
-rw-r--r-- | st.h | 2 | ||||
-rw-r--r-- | x.c | 6 |
3 files changed, 7 insertions, 7 deletions
@@ -905,14 +905,14 @@ ttysend(char *s, size_t n) | |||
905 | } | 905 | } |
906 | 906 | ||
907 | void | 907 | void |
908 | ttyresize(void) | 908 | ttyresize(int tw, int th) |
909 | { | 909 | { |
910 | struct winsize w; | 910 | struct winsize w; |
911 | 911 | ||
912 | w.ws_row = term.row; | 912 | w.ws_row = term.row; |
913 | w.ws_col = term.col; | 913 | w.ws_col = term.col; |
914 | w.ws_xpixel = win.tw; | 914 | w.ws_xpixel = tw; |
915 | w.ws_ypixel = win.th; | 915 | w.ws_ypixel = th; |
916 | if (ioctl(cmdfd, TIOCSWINSZ, &w) < 0) | 916 | if (ioctl(cmdfd, TIOCSWINSZ, &w) < 0) |
917 | fprintf(stderr, "Couldn't set window size: %s\n", strerror(errno)); | 917 | fprintf(stderr, "Couldn't set window size: %s\n", strerror(errno)); |
918 | } | 918 | } |
@@ -187,7 +187,7 @@ void tsetdirtattr(int); | |||
187 | int match(uint, uint); | 187 | int match(uint, uint); |
188 | void ttynew(void); | 188 | void ttynew(void); |
189 | size_t ttyread(void); | 189 | size_t ttyread(void); |
190 | void ttyresize(void); | 190 | void ttyresize(int, int); |
191 | void ttysend(char *, size_t); | 191 | void ttysend(char *, size_t); |
192 | void ttywrite(const char *, size_t); | 192 | void ttywrite(const char *, size_t); |
193 | 193 | ||
@@ -192,7 +192,7 @@ zoomabs(const Arg *arg) | |||
192 | xunloadfonts(); | 192 | xunloadfonts(); |
193 | xloadfonts(usedfont, arg->f); | 193 | xloadfonts(usedfont, arg->f); |
194 | cresize(0, 0); | 194 | cresize(0, 0); |
195 | ttyresize(); | 195 | ttyresize(win.tw, win.th); |
196 | redraw(); | 196 | redraw(); |
197 | xhints(); | 197 | xhints(); |
198 | } | 198 | } |
@@ -1679,7 +1679,7 @@ resize(XEvent *e) | |||
1679 | return; | 1679 | return; |
1680 | 1680 | ||
1681 | cresize(e->xconfigure.width, e->xconfigure.height); | 1681 | cresize(e->xconfigure.width, e->xconfigure.height); |
1682 | ttyresize(); | 1682 | ttyresize(win.tw, win.th); |
1683 | } | 1683 | } |
1684 | 1684 | ||
1685 | void | 1685 | void |
@@ -1710,7 +1710,7 @@ run(void) | |||
1710 | 1710 | ||
1711 | cresize(w, h); | 1711 | cresize(w, h); |
1712 | ttynew(); | 1712 | ttynew(); |
1713 | ttyresize(); | 1713 | ttyresize(win.tw, win.th); |
1714 | 1714 | ||
1715 | clock_gettime(CLOCK_MONOTONIC, &last); | 1715 | clock_gettime(CLOCK_MONOTONIC, &last); |
1716 | lastblink = last; | 1716 | lastblink = last; |