summaryrefslogtreecommitdiff
path: root/Xi/xipassivegrab.c
diff options
context:
space:
mode:
Diffstat (limited to 'Xi/xipassivegrab.c')
-rw-r--r--Xi/xipassivegrab.c10
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)
&param, XI2, &mask);
break;
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;
+ else
+ status = GrabKey(client, dev, mod_dev, stuff->detail,
+ &param, XI2, &mask);
break;
case XIGrabtypeEnter:
case XIGrabtypeFocusIn: