aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2017-10-10 15:51:23 -0500
committerDevin J. Pohly <djpohly@gmail.com>2018-02-25 21:53:24 -0600
commitdbe8676d7d69651132bde2b6d9ec3787cbbc552a (patch)
tree06b6397a18b266085f5b89677521dd441c860b4f
parenta8314643b1aeaa2187dad71dc5748aaac1760c1b (diff)
downloadst-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.c6
-rw-r--r--st.h2
-rw-r--r--x.c6
3 files changed, 7 insertions, 7 deletions
diff --git a/st.c b/st.c
index 75c191d..839dc94 100644
--- a/st.c
+++ b/st.c
@@ -905,14 +905,14 @@ ttysend(char *s, size_t n)
905} 905}
906 906
907void 907void
908ttyresize(void) 908ttyresize(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}
diff --git a/st.h b/st.h
index 5d44411..372462d 100644
--- a/st.h
+++ b/st.h
@@ -187,7 +187,7 @@ void tsetdirtattr(int);
187int match(uint, uint); 187int match(uint, uint);
188void ttynew(void); 188void ttynew(void);
189size_t ttyread(void); 189size_t ttyread(void);
190void ttyresize(void); 190void ttyresize(int, int);
191void ttysend(char *, size_t); 191void ttysend(char *, size_t);
192void ttywrite(const char *, size_t); 192void ttywrite(const char *, size_t);
193 193
diff --git a/x.c b/x.c
index 01ef1b0..1b656ac 100644
--- a/x.c
+++ b/x.c
@@ -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
1685void 1685void
@@ -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;