diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-05-23 18:48:58 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-05-23 18:48:58 +0000 |
commit | 0a63aaaea5e621ad71bc494676f18a63e8d600de (patch) | |
tree | c047faed2647c93e918c88ddd3dffb9d2ba2c00e /app | |
parent | 8dddd7aa6be8a176fc7528780fc0d215ac6a4266 (diff) |
Grab the keyboard when we initialise the menu. This stops the keyboard
shortcut code stealing our events in some cases.
"put 'er in" okan@.
Diffstat (limited to 'app')
-rw-r--r-- | app/cwm/menu.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/cwm/menu.c b/app/cwm/menu.c index b3a77cf48..a98ad58d4 100644 --- a/app/cwm/menu.c +++ b/app/cwm/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); } |