aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi/grabdev.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-07-25 20:12:58 +0000
committermarha <marha@users.sourceforge.net>2009-07-25 20:12:58 +0000
commit2553bdd7c359cd87525d367761c86932cec5adff (patch)
treeae71245933c98474a699d3e392de5820879b2018 /xorg-server/Xi/grabdev.c
parente2c51f2ee7b0a3ea1a052fc49324057b4a4bbc78 (diff)
parent4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05 (diff)
downloadvcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.tar.gz
vcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.tar.bz2
vcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.zip
svn merge file:///D:/svnrepos/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/Xi/grabdev.c')
-rw-r--r--xorg-server/Xi/grabdev.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/xorg-server/Xi/grabdev.c b/xorg-server/Xi/grabdev.c
index 0671e0ea7..8217a9928 100644
--- a/xorg-server/Xi/grabdev.c
+++ b/xorg-server/Xi/grabdev.c
@@ -131,7 +131,7 @@ ProcXGrabDevice(ClientPtr client)
rc = GrabDevice(client, dev, stuff->this_device_mode,
stuff->other_devices_mode, stuff->grabWindow,
stuff->ownerEvents, stuff->time,
- tmp[stuff->deviceid].mask, &rep.status);
+ tmp[stuff->deviceid].mask, &rep.status, FALSE);
if (rc != Success)
return rc;
@@ -144,6 +144,24 @@ ProcXGrabDevice(ClientPtr client)
*
* This procedure creates an event mask from a list of XEventClasses.
*
+ * Procedure is as follows:
+ * An XEventClass is (deviceid << 8 | eventtype). For each entry in the list,
+ * get the device. Then run through all available event indices (those are
+ * set when XI starts up) and binary OR's the device's mask to whatever the
+ * event mask for the given event type was.
+ * If an error occurs, it is sent to the client. Errors are generated if
+ * - if the device given in the event classs is invalid
+ * - if the device in the class list is not the device given as parameter (no
+ * error if parameter is NULL)
+ *
+ * mask has to be size EMASKSIZE and pre-allocated.
+ *
+ * @param client The client to send the error to (if one occurs)
+ * @param list List of event classes as sent from the client.
+ * @param count Number of elements in list.
+ * @param mask Preallocated mask (size EMASKSIZE).
+ * @param dev The device we're creating masks for.
+ * @param req The request we're processing. Used to fill in error fields.
*/
int
@@ -161,7 +179,7 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
for (i = 0; i < count; i++, list++) {
device = *list >> 8;
- if (device > 255)
+ if (device > 255) /* FIXME: we only use 7 bit for devices? */
return BadClass;
rc = dixLookupDevice(&tdev, device, client, DixReadAccess);