From 8f1c31bf98d16264c2c9c733aa52d58d793f6c64 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 6 Mar 2007 03:24:40 -0500 Subject: [PATCH] Wait for an Expose and draw the menu immediately after mapping the window. --- dmenubar/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dmenubar/main.c b/dmenubar/main.c index beb8411..29b313b 100644 --- a/dmenubar/main.c +++ b/dmenubar/main.c @@ -479,6 +479,8 @@ main(int argc, char *argv[]) { XSetFont(dpy, dc.gc, dc.font.xfont->fid); drawmenu(); XMapRaised(dpy, win); + XMaskEvent(dpy, ExposureMask, &ev); + drawmenu(); if(isatty(STDIN_FILENO)) { maxname = readstdin(); grabkeyboard(); @@ -506,6 +508,7 @@ main(int argc, char *argv[]) { promptw = mw / 5; text[0] = 0; match(text); + drawmenu(); XSync(dpy, False); /* main event loop */ @@ -516,10 +519,6 @@ main(int argc, char *argv[]) { case KeyPress: kpress(&ev.xkey); break; - case Expose: - if(ev.xexpose.count == 0) - drawmenu(); - break; } /* cleanup */