X-Git-Url: https://jasonwoof.com/gitweb/?p=st.git;a=blobdiff_plain;f=st.c;h=0fc724b2dc43060fd842901e6c8f512626b8c684;hp=ac1954e4a20e56949f38dc2be871ea957298fcab;hb=fbc589d50603e8b0de9239e4800e227ab5d0ea69;hpb=6fc471ccc660b305cf836dcb8d57cdbffb4ed017 diff --git a/st.c b/st.c index ac1954e..0fc724b 100644 --- a/st.c +++ b/st.c @@ -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;