Pass new dimensions into ttyresize This removes another reference to TermWindow from st.c. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
Devin J. Pohly djpohly@gmail.com
M
st.c
→
st.c
@@ -905,14 +905,14 @@ }
} 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)); }
M
x.c
→
x.c
@@ -192,7 +192,7 @@ {
xunloadfonts(); xloadfonts(usedfont, arg->f); cresize(0, 0); - ttyresize(); + ttyresize(win.tw, win.th); redraw(); xhints(); }@@ -1679,7 +1679,7 @@ if (e->xconfigure.width == win.w && e->xconfigure.height == win.h)
return; cresize(e->xconfigure.width, e->xconfigure.height); - ttyresize(); + ttyresize(win.tw, win.th); } void@@ -1710,7 +1710,7 @@ } while (ev.type != MapNotify);
cresize(w, h); ttynew(); - ttyresize(); + ttyresize(win.tw, win.th); clock_gettime(CLOCK_MONOTONIC, &last); lastblink = last;