Re: [wmii] small patch for wmiimenu.c

From: Anselm R. Garbe <garbeam_AT_wmii.de>
Date: Wed, 3 May 2006 13:08:00 +0200

On Wed, May 03, 2006 at 12:52:12PM +0200, 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);

You overlooked a small issue, because screen is initialized
after its first use, but I apply your patch with this fix ;)

Regards,

-- 
 Anselm R. Garbe  ><><  www.ebrag.de  ><><  GPG key: 0D73F361
Received on Wed May 03 2006 - 13:08:00 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 16:04:10 UTC