Commit f4cdbf64 authored by Peter Hutterer's avatar Peter Hutterer Committed by Adam Jackson

Xi: return AlreadyGrabbed for key grabs > 255

We can't have high keycodes because everything in XKB relies on 8 bits. XI2's
API allows for 32-bit keycodes so we have to take those but nothing in the
server is really ready for this. The effect of this right now is that any high
keycode grab is clipped to 255 and thus ends up grabbing a different key
instead. Peter Hutterer's avatarPeter Hutterer <>
parent dea4a746
......@@ -203,8 +203,14 @@ ProcXIPassiveGrabDevice(ClientPtr client)
&param, XI2, &mask);
case XIGrabtypeKeycode:
status = GrabKey(client, dev, mod_dev, stuff->detail,
&param, XI2, &mask);
/* XI2 allows 32-bit keycodes but thanks to XKB we can never
* implement this. Just return an error for all keycodes that
* cannot work anyway */
if (stuff->detail > 255)
status = XIAlreadyGrabbed;
status = GrabKey(client, dev, mod_dev, stuff->detail,
&param, XI2, &mask);
case XIGrabtypeEnter:
case XIGrabtypeFocusIn:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment