[PATCH] xkb: convert XkbUseCorePtr and XkbUseCoreKbd into PickPointer/Keyboard.

Peter Hutterer peter.hutterer at who-t.net
Wed Jan 13 22:06:43 PST 2010


Convert the fake ID XkbUseCorePtr and XkbUseCoreKbd ids to the real core
pointer/keyboard for this particular client by using PickPointer and
PickKeyboard.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 xkb/xkb.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xkb/xkb.c b/xkb/xkb.c
index bfed114..2b69fce 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -54,11 +54,14 @@ static RESTYPE	RT_XKBCLIENT;
 
 /***====================================================================***/
 
-#define	CHK_DEVICE(dev, id, client, access_mode, lf) {\
+#define	CHK_DEVICE(dev, deviceid, client, access_mode, lf) {\
     int why;\
-    int rc = lf(&(dev), id, client, access_mode, &why);\
+    int rc; \
+    if (deviceid == XkbUseCorePtr) deviceid = PickPointer(client)->id; \
+    else if (deviceid == XkbUseCoreKbd) deviceid = PickKeyboard(client)->id; \
+    rc = lf(&(dev), deviceid, client, access_mode, &why);\
     if (rc != Success) {\
-	client->errorValue = _XkbErrCode2(why, id);\
+	client->errorValue = _XkbErrCode2(why, deviceid);\
 	return rc;\
     }\
 }
-- 
1.6.6



More information about the xorg-devel mailing list