diff options
author | Kris Maglione <jg@suckless.org> | 2007-03-06 03:24:40 -0500 |
---|---|---|
committer | Kris Maglione <jg@suckless.org> | 2007-03-06 03:24:40 -0500 |
commit | 9911455f5b7787c999a570faf33cf6ad0bec056c (patch) | |
tree | 8b0ba3c847b2b13b22a7fc202de3ffce67d74452 | |
parent | 2772c51e79a5bfdf60103da02af63d972fecf9cf (diff) |
Wait for an Expose and draw the menu immediately after mapping the window.
-rw-r--r-- | main.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -479,6 +479,8 @@ main(int argc, char *argv[]) { | |||
479 | XSetFont(dpy, dc.gc, dc.font.xfont->fid); | 479 | XSetFont(dpy, dc.gc, dc.font.xfont->fid); |
480 | drawmenu(); | 480 | drawmenu(); |
481 | XMapRaised(dpy, win); | 481 | XMapRaised(dpy, win); |
482 | XMaskEvent(dpy, ExposureMask, &ev); | ||
483 | drawmenu(); | ||
482 | if(isatty(STDIN_FILENO)) { | 484 | if(isatty(STDIN_FILENO)) { |
483 | maxname = readstdin(); | 485 | maxname = readstdin(); |
484 | grabkeyboard(); | 486 | grabkeyboard(); |
@@ -506,6 +508,7 @@ main(int argc, char *argv[]) { | |||
506 | promptw = mw / 5; | 508 | promptw = mw / 5; |
507 | text[0] = 0; | 509 | text[0] = 0; |
508 | match(text); | 510 | match(text); |
511 | drawmenu(); | ||
509 | XSync(dpy, False); | 512 | XSync(dpy, False); |
510 | 513 | ||
511 | /* main event loop */ | 514 | /* main event loop */ |
@@ -516,10 +519,6 @@ main(int argc, char *argv[]) { | |||
516 | case KeyPress: | 519 | case KeyPress: |
517 | kpress(&ev.xkey); | 520 | kpress(&ev.xkey); |
518 | break; | 521 | break; |
519 | case Expose: | ||
520 | if(ev.xexpose.count == 0) | ||
521 | drawmenu(); | ||
522 | break; | ||
523 | } | 522 | } |
524 | 523 | ||
525 | /* cleanup */ | 524 | /* cleanup */ |