diff options
author | Quentin Rameau <quinq@fifth.space> | 2016-01-30 17:54:41 +0100 |
---|---|---|
committer | Christoph Lohmann <20h@r-36.net> | 2016-01-30 18:40:13 +0100 |
commit | 6e70bb97d4e98a5e2fa7c5488b0cba1da140b78f (patch) | |
tree | 86d572ff22a17c848079353ca9e9f764c16e5f04 | |
parent | 82335583eba15e87749d0e663270353005fca30b (diff) | |
download | st-patched-6e70bb97d4e98a5e2fa7c5488b0cba1da140b78f.tar.bz2 st-patched-6e70bb97d4e98a5e2fa7c5488b0cba1da140b78f.tar.xz st-patched-6e70bb97d4e98a5e2fa7c5488b0cba1da140b78f.zip |
Extract ttyresize() out of cresize()
This way we can call cresize() to set the terminal size before creating
a tty or spawning a process, which will start with the correct size.
Signed-off-by: Christoph Lohmann <20h@r-36.net>
-rw-r--r-- | st.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1441,8 +1441,6 @@ ttynew(void) | |||
1441 | if (openpty(&m, &s, NULL, NULL, &w) < 0) | 1441 | if (openpty(&m, &s, NULL, NULL, &w) < 0) |
1442 | die("openpty failed: %s\n", strerror(errno)); | 1442 | die("openpty failed: %s\n", strerror(errno)); |
1443 | 1443 | ||
1444 | ttyresize(); | ||
1445 | |||
1446 | switch (pid = fork()) { | 1444 | switch (pid = fork()) { |
1447 | case -1: | 1445 | case -1: |
1448 | die("fork failed\n"); | 1446 | die("fork failed\n"); |
@@ -3427,6 +3425,7 @@ xzoomabs(const Arg *arg) | |||
3427 | xunloadfonts(); | 3425 | xunloadfonts(); |
3428 | xloadfonts(usedfont, arg->f); | 3426 | xloadfonts(usedfont, arg->f); |
3429 | cresize(0, 0); | 3427 | cresize(0, 0); |
3428 | ttyresize(); | ||
3430 | redraw(); | 3429 | redraw(); |
3431 | xhints(); | 3430 | xhints(); |
3432 | } | 3431 | } |
@@ -4210,7 +4209,6 @@ cresize(int width, int height) | |||
4210 | 4209 | ||
4211 | tresize(col, row); | 4210 | tresize(col, row); |
4212 | xresize(col, row); | 4211 | xresize(col, row); |
4213 | ttyresize(); | ||
4214 | } | 4212 | } |
4215 | 4213 | ||
4216 | void | 4214 | void |
@@ -4220,6 +4218,7 @@ resize(XEvent *e) | |||
4220 | return; | 4218 | return; |
4221 | 4219 | ||
4222 | cresize(e->xconfigure.width, e->xconfigure.height); | 4220 | cresize(e->xconfigure.width, e->xconfigure.height); |
4221 | ttyresize(); | ||
4223 | } | 4222 | } |
4224 | 4223 | ||
4225 | void | 4224 | void |
@@ -4248,8 +4247,9 @@ run(void) | |||
4248 | } | 4247 | } |
4249 | } while (ev.type != MapNotify); | 4248 | } while (ev.type != MapNotify); |
4250 | 4249 | ||
4251 | ttynew(); | ||
4252 | cresize(w, h); | 4250 | cresize(w, h); |
4251 | ttynew(); | ||
4252 | ttyresize(); | ||
4253 | 4253 | ||
4254 | clock_gettime(CLOCK_MONOTONIC, &last); | 4254 | clock_gettime(CLOCK_MONOTONIC, &last); |
4255 | lastblink = last; | 4255 | lastblink = last; |