Good, I hate having to wait a few.. millisecs(?), almost a whole sec
before typing the command, which often is mpc next ^^
WUSTRACK Jonas wrote:
Hi,
I've noticed that sometimes when calling wmiimenu and beginning to
type just after, the first characters are ignored by wmiimenu and thus
sent to the selected client. This can be quite annoying especially
with clients like vi.
Thus I've made a simple patch, putting the XKeyGrab call as early as
possible in main (so just after the initialization of dpy).
It worked for me and I don't think it could cause any problems on
other systems.
Here's the patch (hg diff on the lastest hg):
--- a/cmd/wmiimenu.c Tue May 02 20:11:44 2006 +0000
+++ b/cmd/wmiimenu.c Wed May 03 12:45:57 2006 +0200
@@ -336,6 +336,12 @@ main(int argc, char *argv[])
fprintf(stderr, "%s", "wmiimenu: cannot open display\n");
exit(1);
}
+
+ while(XGrabKeyboard
+ (dpy, RootWindow(dpy, screen), True,
GrabModeAsync,
+ GrabModeAsync, CurrentTime) != GrabSuccess)
+ usleep(1000);
+
screen = DefaultScreen(dpy);
/* set font and colors */
@@ -383,11 +389,6 @@ main(int argc, char *argv[])
draw_menu();
XSync(dpy, False);
- while(XGrabKeyboard
- (dpy, RootWindow(dpy, screen), True,
GrabModeAsync,
- GrabModeAsync, CurrentTime) != GrabSuccess)
- usleep(1000);
-
/* main event loop */
while(!XNextEvent(dpy, &ev)) {
Regards,
Jonas Wustrack (doez)
------------------------------------------------------------------------
_______________________________________________
[email protected] mailing list
http://wmii.de/cgi-bin/mailman/listinfo/wmii
_______________________________________________
[email protected] mailing list
http://wmii.de/cgi-bin/mailman/listinfo/wmii