[PATCH xserver 11/12] input: deliver raw events unconditionally for XI 2.1 clients.
Jeremy Huddleston
jeremyhu at apple.com
Sun Jun 5 18:30:24 PDT 2011
On Jun 5, 2011, at 9:22 PM, Peter Hutterer wrote:
> On Fri, Jun 03, 2011 at 11:40:02PM -0400, Jeremy Huddleston wrote:
>> 5-10, 12:
>> Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
>>
>> 11:
>>
>> This looks odd. You're only going to deliver to the first client:
>>
>> + for (; inputclients; inputclients = inputclients->next)
>> {
>> + ClientPtr c; /* unused */
>> + Mask m; /* unused */
>> + InputClients ic = *inputclients;
>>
>> + /* Because we run through the list manually, terminate the list
>> + * after our current client */
>> + ic.next = NULL;
>> + if (!FilterRawEvents(rClient(&ic), grab))
>> + DeliverEventToInputClients(device, &ic, root, xi, 1,
>> + filter, NULL, &c, &m);
>> + }
>
> inputclients is a list on the window that contains all clients that
> registered for events on the window. DeliverEventToInputClients delivers too
> all clients in that list.
>
> Because raw event delivery is different (we must take care to not deliver
> the same event twice), we need to handle the list ourselves here.
> so of the inputclients list, we copy the first list item into a temporary
> list "ic", then terminate that list and deliver the event. then copy the
> second one into a tmp list, etc.
Ah right. I read that too fast ... for some reason, I thought that was refering to the rect in the list (and thus you were setting the original's next to NULL) ... after reading it a second time, it makes more sense ... albeit still quite hacky.
> it's a bit of a hack, but otherwise an XI2.1 client with a device grab will
> get the raw events twice, once as part of the grab, once as part of the
> normal event delivery.
Could you please expand the comment you have there with this detail, then:
Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
More information about the xorg-devel
mailing list