tPass new dimensions into ttyresize - st - [fork] customized build of st, the s… | |
git clone git://src.adamsgaard.dk/st | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit dbe8676d7d69651132bde2b6d9ec3787cbbc552a | |
parent a8314643b1aeaa2187dad71dc5748aaac1760c1b | |
Author: Devin J. Pohly <[email protected]> | |
Date: Tue, 10 Oct 2017 15:51:23 -0500 | |
Pass new dimensions into ttyresize | |
This removes another reference to TermWindow from st.c. | |
Signed-off-by: Devin J. Pohly <[email protected]> | |
Diffstat: | |
M st.c | 6 +++--- | |
M st.h | 2 +- | |
M x.c | 6 +++--- | |
3 files changed, 7 insertions(+), 7 deletions(-) | |
--- | |
diff --git a/st.c b/st.c | |
t@@ -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(err… | |
} | |
diff --git a/st.h b/st.h | |
t@@ -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 | |
t@@ -192,7 +192,7 @@ zoomabs(const Arg *arg) | |
xunloadfonts(); | |
xloadfonts(usedfont, arg->f); | |
cresize(0, 0); | |
- ttyresize(); | |
+ ttyresize(win.tw, win.th); | |
redraw(); | |
xhints(); | |
} | |
t@@ -1679,7 +1679,7 @@ resize(XEvent *e) | |
return; | |
cresize(e->xconfigure.width, e->xconfigure.height); | |
- ttyresize(); | |
+ ttyresize(win.tw, win.th); | |
} | |
void | |
t@@ -1710,7 +1710,7 @@ run(void) | |
cresize(w, h); | |
ttynew(); | |
- ttyresize(); | |
+ ttyresize(win.tw, win.th); | |
clock_gettime(CLOCK_MONOTONIC, &last); | |
lastblink = last; |