]> git.armaanb.net Git - st.git/commitdiff
Pass new dimensions into ttyresize
authorDevin J. Pohly <djpohly@gmail.com>
Tue, 10 Oct 2017 20:51:23 +0000 (15:51 -0500)
committerDevin J. Pohly <djpohly@gmail.com>
Mon, 26 Feb 2018 03:53:24 +0000 (21:53 -0600)
This removes another reference to TermWindow from st.c.

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
st.c
st.h
x.c

diff --git a/st.c b/st.c
index 75c191de8c5dffc99acc99394a3e38400323c15b..839dc94db7621e4bbc9d29b2792ebfb0515a625f 100644 (file)
--- a/st.c
+++ b/st.c
@@ -905,14 +905,14 @@ ttysend(char *s, size_t n)
 }
 
 void
-ttyresize(void)
+ttyresize(int tw, int th)
 {
        struct winsize w;
 
        w.ws_row = term.row;
        w.ws_col = term.col;
-       w.ws_xpixel = win.tw;
-       w.ws_ypixel = win.th;
+       w.ws_xpixel = tw;
+       w.ws_ypixel = th;
        if (ioctl(cmdfd, TIOCSWINSZ, &w) < 0)
                fprintf(stderr, "Couldn't set window size: %s\n", strerror(errno));
 }
diff --git a/st.h b/st.h
index 5d4441173fcb1a526feedb5641e1d0f111f740d1..372462da2436b2e959b2151c7e848e3349daae1b 100644 (file)
--- a/st.h
+++ b/st.h
@@ -187,7 +187,7 @@ void tsetdirtattr(int);
 int match(uint, uint);
 void ttynew(void);
 size_t ttyread(void);
-void ttyresize(void);
+void ttyresize(int, int);
 void ttysend(char *, size_t);
 void ttywrite(const char *, size_t);
 
diff --git a/x.c b/x.c
index 01ef1b00204b073d254f469c5c1894bd9acd60a6..1b656aca1636f871eea9af371139ce921f7721a7 100644 (file)
--- a/x.c
+++ b/x.c
@@ -192,7 +192,7 @@ zoomabs(const Arg *arg)
        xunloadfonts();
        xloadfonts(usedfont, arg->f);
        cresize(0, 0);
-       ttyresize();
+       ttyresize(win.tw, win.th);
        redraw();
        xhints();
 }
@@ -1679,7 +1679,7 @@ resize(XEvent *e)
                return;
 
        cresize(e->xconfigure.width, e->xconfigure.height);
-       ttyresize();
+       ttyresize(win.tw, win.th);
 }
 
 void
@@ -1710,7 +1710,7 @@ run(void)
 
        cresize(w, h);
        ttynew();
-       ttyresize();
+       ttyresize(win.tw, win.th);
 
        clock_gettime(CLOCK_MONOTONIC, &last);
        lastblink = last;