[PATCH] Count the number of logically down buttons in buttonsDown
Thomas Jaeger
thjaeger at gmail.com
Mon Jan 5 08:55:40 PST 2009
I've been wondering for a while if this change was necessary; it turns
out it is, a test case is mentioned in the commit message.
Peter Hutterer wrote:
>> Thomas Jaeger wrote:
>>> I can't see any reason why we would treat buttons > 5 differently. This
>>> patch simplifies client code by eliminating the need to call XGrabDevice
>>> after a button has been pressed and prevents race conditions that could
>>> result from that.
>
>
> Following up on that:
> Both the core protocol and the XI protocol spec state that a passive grab is
> to be released when all buttons are logically up, regardless of modifiers.
> This is where the magic number 5 comes in. Core allows for 5 buttons, XI
> allows for more.
>
> This puts us in a difficult position. Core requires us to release the grab if,
> say, only button 6 is down. XI requires us to maintain the grab.
> I think we need a more complex solution than the one you proposed: test
> whether the passive grab is a core or an XI grab and release depending on this
> condition.
> Something like
> if ((grab->coreGrab && !button->state) && ... ||
> (!grab->coreGrab && AllButtonsAreUp(b))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Count-the-number-of-logically-down-buttons-in-button.patch
Type: text/x-patch
Size: 2523 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20090105/98866fc2/attachment.bin>
More information about the xorg
mailing list