[PATCH weston v2 3/3] compositor-x11: remove manual mouse button grab/ungrab

Daniel Stone daniel at fooishbar.org
Thu Jun 23 07:55:01 UTC 2016


Hi,

On 19 May 2016 at 05:32, Benoit Gschwind <gschwind at gnu-log.net> wrote:
> In current compositor-x11, the mouse buttons are grabbed and ungrabbed
> manually that may produce weird cases like starting a grab while the
> buttons are already released, due to asynchronous X11 events dispatching.
>
> The patch avoid the issue by using the better passive button grab, that
> automatically grab buttons as soon as they occur. The passive grab
> include an automatic ungrab when all mouse button are released.
>
> This probably fix some mysterious bugs.

Hm, have you observed this in practice? Passing button_event->time,
rather than CurrentTime, should ensure that the grab does not take
effect if there has been another button press, since I believe that
will subsequently update the last grab time in the server. Even if it
did, we would ungrab the pointer as soon as we receive the button
release - which we are guaranteed to do thanks to implicit grabs.

I think it's a reasonable and good change to have, but am not
convinced by the reasoning for it.

Cheers,
Daniel


More information about the wayland-devel mailing list