Have keyboard events "bypass" grabbed pointer

Thomas L├╝bking thomas.luebking at gmx.de
Thu Feb 16 07:52:49 UTC 2017

Am Thu, 16 Feb 2017 09:27:32 +1000
schrieb Peter Hutterer <peter.hutterer at who-t.net>:

> find documentation for xlib, that's usually quite ok for these bits
> (or the protocol directly). But yes, ReplayKeyboard ungrabs, so you
> have to immediately grab the keyboard again.

If the regrab fails, this is likely because some other client (the WM?)
grabbed the keyboard for the input. Check the status return code and
cycle regrab attempts. If they fail "too long" cancel the screenlocker
(while that's of course still a security risk, it's at least exposed)

If you've a specific setup, it's more reliable to pass down the
keypress by a side channel (dbus, or eg. alter an x property on the
root window which the WM tracks) than to open the keyboard.


More information about the xorg mailing list