From 15ebf6bebd521e4e1fcb64959ea5a6180b9b951c Mon Sep 17 00:00:00 2001 From: oga Date: Fri, 23 May 2008 18:48:57 +0000 Subject: Grab the keyboard when we initialise the menu. This stops the keyboard shortcut code stealing our events in some cases. "put 'er in" okan@. --- menu.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'menu.c') diff --git a/menu.c b/menu.c index b3a77cf..a98ad58 100644 --- a/menu.c +++ b/menu.c @@ -118,6 +118,10 @@ menu_filter(struct menu_q *menuq, char *prompt, char *initial, int dummy, XGetInputFocus(X_Dpy, &focuswin, &focusrevert); XSetInputFocus(X_Dpy, sc->menuwin, RevertToPointerRoot, CurrentTime); + /* make sure keybindings don't remove keys from the menu stream */ + XGrabKeyboard(X_Dpy, sc->menuwin, True, + GrabModeAsync, GrabModeAsync, CurrentTime); + for (;;) { mc.changed = 0; @@ -153,6 +157,7 @@ out: } XUnmapWindow(X_Dpy, sc->menuwin); + XUngrabKeyboard(X_Dpy, CurrentTime); return (mi); } -- cgit v1.2.3-2-gb3c3