[PATCH xserver 2/2] Xi: Fix passive key grabs on XIAll[Master]Devices

carlosg at gnome.org carlosg at gnome.org
Tue Aug 30 15:46:53 PDT 2011


From: Carlos Garnacho <carlosg at gnome.org>

The KeyClass is not set for these DeviceIntRec, but it's only used
for XI1 grabs in order to check the XKB keycode range, and
XIAll[Master]Devices doesn't apply there. So only spare the NULL
check for XI grabs.

Signed-off-by: Carlos Garnacho <carlosg at gnome.org>
---
 Xi/exevents.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 3e3c67b..b279972 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1441,10 +1441,11 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
     rc = CheckGrabValues(client, param);
     if (rc != Success)
         return rc;
-    if (k == NULL)
-	return BadMatch;
     if (grabtype == GRABTYPE_XI)
     {
+        if (k == NULL)
+            return BadMatch;
+
         if ((key > k->xkbInfo->desc->max_key_code ||
                     key < k->xkbInfo->desc->min_key_code)
                 && (key != AnyKey)) {
-- 
1.7.6



More information about the xorg-devel mailing list