From: Carlos Garnacho <[email protected]>

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 <[email protected]>
---
 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

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to