[hackers] [dmenu] Wait for an Expose and draw the menu immediately after mapping the window.

From: Kris Maglione <jg_AT_suckless.org>
Date: Tue Mar 06 09:25:09 2007

changeset: 189:5b2624e7a87d
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Tue Mar 06 03:24:40 2007 -0500
summary: Wait for an Expose and draw the menu immediately after mapping the window.

diff -r 3deb0828d6c8 -r 5b2624e7a87d main.c
--- a/main.c Mon Mar 05 11:25:18 2007 +0100
+++ b/main.c Tue Mar 06 03:24:40 2007 -0500
@@ -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 */
@@ -515,10 +518,6 @@ main(int argc, char *argv[]) {
                         break;
                 case KeyPress:
                         kpress(&ev.xkey);
- break;
- case Expose:
- if(ev.xexpose.count == 0)
- drawmenu();
                         break;
                 }
 
Received on Tue Mar 06 2007 - 09:25:09 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:56:12 UTC