diff options
Diffstat (limited to 'xorg-server/Xi/grabdev.c')
-rw-r--r-- | xorg-server/Xi/grabdev.c | 22 |
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); |