Use do..while in window mapping loop.
authornoname@inventati.org <noname@inventati.org>
Sat, 11 Apr 2015 10:18:57 +0000 (12:18 +0200)
committerRoberto E. Vargas Caballero <k0ga@shike2.com>
Mon, 13 Apr 2015 07:15:42 +0000 (09:15 +0200)
st.c

diff --git a/st.c b/st.c
index b2bcfe9..83acd56 100644 (file)
--- a/st.c
+++ b/st.c
@@ -3917,17 +3917,15 @@ run(void) {
        long deltatime;
 
        /* Waiting for window mapping */
-       while(1) {
+       do {
                XNextEvent(xw.dpy, &ev);
                if(XFilterEvent(&ev, None))
                        continue;
                if(ev.type == ConfigureNotify) {
                        w = ev.xconfigure.width;
                        h = ev.xconfigure.height;
-               } else if(ev.type == MapNotify) {
-                       break;
                }
-       }
+       } while(ev.type != MapNotify);
 
        ttynew();
        cresize(w, h);