[PATCH] Revert "dix: use the event mask of the grab for TryClientEvents."

Keith Packard keithp at keithp.com
Thu Jun 24 17:18:46 PDT 2010


On Fri, 25 Jun 2010 09:48:10 +1000, Peter Hutterer <peter.hutterer at who-t.net> wrote:

> Behaviour of earlier X servers was to deliver the ButtonPress event
> unconditionally, regardless of the actual event mask being set. Thus, a
> GrabButton event will always deliver the button press event, a GrabKey
> always the key press event, etc. Same goes for XI and XI2.

The earlier X server implementation agrees with my reading of the spec
in which the GrabButton request definition says:

"This request establishes a passive grab.  In the future, the pointer is
 actively grabbed as described in GrabPointer, the last-pointer-grab
 time is set to the time at which the button was pressed (as transmitted
 in the ButtonPress event), and the ButtonPress event is reported if all
 of the following conditions are true:"

The ButtonPress event is unconditionally "reported". Reading other areas
of the X protocol spec, it seems clear that "reported" means delivered
to a client, not just generated internally within the server and passed
through the normal event checks later on, in particular, the definition
of the window 'event-mask' says:

"Multiple clients can select input on the same window; their event-masks
 are disjoint.  When an event is generated, it will be reported to all
 interested clients.  However, only one client at a time can select for
 SubstructureRedirect, only one client at a time can select for
 ResizeRedirect, and only one client at a time can select for
 ButtonPress.  An attempt to violate these restrictions results in an
 Access error."

In this case, "reported" clearly means delivered to a client. So, if we
interpret the GrabButton usage of "reported" in the same way, then the
event should be delivered unconditionally.

> XTS test results for XGrabButton are identical with and without this
> patch.

Sure would be nice to have a test case which checks this behaviour...

> This reverts commit 48585bd1e3e98db0f3df1ecc68022510216e00cc.
> 
> Conflicts:
> 
> 	dix/events.c
> 
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

Reviewed-by: Keith Packard <keithp at keithp.com>

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100624/58edaea6/attachment-0001.pgp>


More information about the xorg-devel mailing list