mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Grab the keyboard when we initialise the menu. This stops the keyboard
shortcut code stealing our events in some cases. "put 'er in" okan@.
This commit is contained in:
parent
779cf04f05
commit
48528d9ba1
5
menu.c
5
menu.c
@ -118,6 +118,10 @@ menu_filter(struct menu_q *menuq, char *prompt, char *initial, int dummy,
|
|||||||
XGetInputFocus(X_Dpy, &focuswin, &focusrevert);
|
XGetInputFocus(X_Dpy, &focuswin, &focusrevert);
|
||||||
XSetInputFocus(X_Dpy, sc->menuwin, RevertToPointerRoot, CurrentTime);
|
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 (;;) {
|
for (;;) {
|
||||||
mc.changed = 0;
|
mc.changed = 0;
|
||||||
|
|
||||||
@ -153,6 +157,7 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
XUnmapWindow(X_Dpy, sc->menuwin);
|
XUnmapWindow(X_Dpy, sc->menuwin);
|
||||||
|
XUngrabKeyboard(X_Dpy, CurrentTime);
|
||||||
|
|
||||||
return (mi);
|
return (mi);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user