Return AlreadyGrabbed for keycodes > 255 (#1697804)

This commit is contained in:
Peter Hutterer 2019-06-06 09:20:27 +10:00
parent 9b1cb6ee15
commit 9f7e9a83a5
2 changed files with 48 additions and 1 deletions

View File

@ -0,0 +1,42 @@
From 0ad717edcf372425ddf2ba9926857419ab62f4f5 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Wed, 29 May 2019 16:19:55 +1000
Subject: [PATCH xserver] 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>
---
Xi/xipassivegrab.c | 10 ++++++++--
1 file 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:
--
2.21.0

View File

@ -46,7 +46,7 @@
Summary: X.Org X11 X server
Name: xorg-x11-server
Version: 1.20.5
Release: 1%{?gitdate:.%{gitdate}}%{?dist}
Release: 2%{?gitdate:.%{gitdate}}%{?dist}
URL: http://www.x.org
License: MIT
@ -101,6 +101,8 @@ Patch22: 0002-modesetting-Propagate-more-failure-in-drmmode_set_mo.patch
Patch23: 0003-modesetting-Factor-out-drmmode_target_output.patch
Patch24: 0004-modesetting-Use-atomic-instead-of-per-crtc-walks-whe.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1697804
Patch25: 0001-Xi-return-AlreadyGrabbed-for-key-grabs-255.patch
BuildRequires: systemtap-sdt-devel
BuildRequires: git
@ -526,6 +528,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete
%changelog
* Thu Jun 06 2019 Peter Hutterer <peter.hutterer@redhat.com> 1.20.5-2
- Return AlreadyGrabbed for keycodes > 255 (#1697804)
* Thu May 30 2019 Adam Jackson <ajax@redhat.com> - 1.20.5-1
- xserver 1.20.5