[hackers] [st] [PATCH] pass new dimensions into ttyresize

From: Devin J. Pohly <djpohly_AT_gmail.com>
Date: Tue, 10 Oct 2017 15:54:31 -0500

This removes another reference to TermWindow from st.c.

Signed-off-by: Devin J. Pohly <djpohly_AT_gmail.com>
---
 st.c | 6 +++---
 st.h | 2 +-
 x.c  | 6 +++---
 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
_AT_@ -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 5d44411..372462d 100644
--- a/st.h
+++ b/st.h
_AT_@ -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 f7e2c73..32f8d92 100644
--- a/x.c
+++ b/x.c
_AT_@ -192,7 +192,7 @@ zoomabs(const Arg *arg)
 	xunloadfonts();
 	xloadfonts(usedfont, arg->f);
 	cresize(0, 0);
-	ttyresize();
+	ttyresize(win.tw, win.th);
 	redraw();
 	xhints();
 }
_AT_@ -1677,7 +1677,7 @@ resize(XEvent *e)
 		return;
 
 	cresize(e->xconfigure.width, e->xconfigure.height);
-	ttyresize();
+	ttyresize(win.tw, win.th);
 }
 
 void
_AT_@ -1708,7 +1708,7 @@ run(void)
 
 	cresize(w, h);
 	ttynew();
-	ttyresize();
+	ttyresize(win.tw, win.th);
 
 	clock_gettime(CLOCK_MONOTONIC, &last);
 	lastblink = last;
-- 
2.14.1
Received on Tue Oct 10 2017 - 22:54:31 CEST

This archive was generated by hypermail 2.3.0 : Tue Oct 10 2017 - 23:00:54 CEST