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

Peter Hutterer peter.hutterer at who-t.net
Thu Jun 24 17:37:47 PDT 2010


On Thu, Jun 24, 2010 at 05:18:46PM -0700, Keith Packard wrote:
> 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...

fwiw, with this patch, XGrabButton test 5/39 now PASSes instead of FAIL.
Of course, you have to run all 39 manually, one-by-one to notice, because
earlier tests don't always reset the modifier state and later tests then
fail when checking the modifier mask in button events. Leads me to think
even more that this patch is correct-ish.

> > 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>

thanks.

Cheers,
  Peter




More information about the xorg-devel mailing list