GSOD: Better keyboard grab
XGrabKeyboard() may fail if Alert*() is called from a child process during an activated passive key grab, e.g. due to a keybinding doing an "exec some-prog", and execl(some-prog) fails. If XGrabKeyboard() fails the GSOD will not receive key events and only the pointer can be used to interact with the GSOD. Therefore we now also grab all possible keys/modifiers which should normally include the Fn keys we want, and to some degree ensure that other keyboard input is caught and ignored. However, it seems that passive key grabs without modifiers may be activated (queued) and prevent further key events to the GSOD - presumably not a major problem in practice.
This commit is contained in:
parent
e05a7293c6
commit
84616e4617
|
@ -314,6 +314,8 @@ ShowAlert(const char *title,
|
|||
XGrabPointer(dd, win, False, ButtonPressMask | ButtonReleaseMask,
|
||||
GrabModeAsync, GrabModeAsync, None, None, CurrentTime);
|
||||
XGrabKeyboard(dd, win, False, GrabModeAsync, GrabModeAsync, CurrentTime);
|
||||
XGrabKey(dd, AnyKey, AnyModifier, win, False, GrabModeAsync, GrabModeAsync);
|
||||
|
||||
XSetInputFocus(dd, win, RevertToPointerRoot, CurrentTime);
|
||||
|
||||
XSync(dd, False);
|
||||
|
|
Loading…
Reference in New Issue