diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2019-05-29 16:19:55 +1000 |
---|---|---|
committer | Adam Jackson <ajax@nwnk.net> | 2019-06-12 16:58:53 +0000 |
commit | f4cdbf640b6440df4af784ca35e1b1340965cc10 (patch) | |
tree | 67b72c17ff59be1ee874bbb174287012dd78eda2 /Xi | |
parent | dea4a74621294391ce5901bb3339e1b8e7151efc (diff) | |
download | xserver-f4cdbf640b6440df4af784ca35e1b1340965cc10.tar.gz |
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.
https://bugzilla.redhat.com/show_bug.cgi?id=1697804
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/xipassivegrab.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c index 65d5870f6..d30f51f3c 100644 --- a/Xi/xipassivegrab.c +++ b/Xi/xipassivegrab.c @@ -203,8 +203,14 @@ ProcXIPassiveGrabDevice(ClientPtr client) ¶m, XI2, &mask); break; case XIGrabtypeKeycode: - status = GrabKey(client, dev, mod_dev, stuff->detail, - ¶m, 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; + else + status = GrabKey(client, dev, mod_dev, stuff->detail, + ¶m, XI2, &mask); break; case XIGrabtypeEnter: case XIGrabtypeFocusIn: |