diff options
author | Alexander Sedov <alex0player@gmail.com> | 2013-06-23 21:05:29 +0400 |
---|---|---|
committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2013-07-04 09:36:22 +0200 |
commit | fbc589d50603e8b0de9239e4800e227ab5d0ea69 (patch) | |
tree | c5db62e806732165360467b4f5d7c07dbeec94bd /st.c | |
parent | 6fc471ccc660b305cf836dcb8d57cdbffb4ed017 (diff) | |
download | st-fbc589d50603e8b0de9239e4800e227ab5d0ea69.tar.gz |
Remove long text being cropped/wrapped to standard 80x24 on launch.
To be more specific, now tty creation is delayed until X window is
actually mapped; last ConfigureNotify before mapping determines
initial tty size.
Please report problems if there are any.
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -3520,10 +3520,28 @@ resize(XEvent *e) { void run(void) { XEvent ev; + int w = xw.w, h = xw.h; fd_set rfd; int xfd = XConnectionNumber(xw.dpy), xev, blinkset = 0, dodraw = 0; struct timeval drawtimeout, *tv = NULL, now, last, lastblink; + /* Waiting for window mapping */ + while(1) { + XNextEvent(xw.dpy, &ev); + if(ev.type == ConfigureNotify) { + w = ev.xconfigure.width; + h = ev.xconfigure.height; + } else if(ev.type == MapNotify) { + break; + } + } + + if(!xw.isfixed) + cresize(w, h); + else + cresize(xw.fw, xw.fh); + ttynew(); + gettimeofday(&lastblink, NULL); gettimeofday(&last, NULL); @@ -3673,10 +3691,7 @@ run: XSetLocaleModifiers(""); tnew(80, 24); xinit(); - ttynew(); selinit(); - if(xw.isfixed) - cresize(xw.h, xw.w); run(); return 0; |