Some of my thoughts on input for wayland

Sam Spilsbury smspillaz at gmail.com
Mon Jan 24 18:26:38 PST 2011


On Tue, Jan 25, 2011 at 6:27 AM, Daniel Stone <daniel at fooishbar.org> wrote:
> Hi,
>
> On Mon, Jan 24, 2011 at 01:04:35PM -0800, Bill Spitzak wrote:
>> Chase Douglas wrote:
>> >Heh, I've heard his distaste of grabs. I haven't had a chance to
>> >research other mechanisms, so I'm just going on what I know through X.
>> >I'm certainly not opposed to a better mechanism :).
>>
>> I really believe passive grabs can be replaced by adding an API that
>> says "I did not handle this event". It can then be passed to another
>> window. The typical grabber would be the *last* one in line, not the
>> first. Wayland itself would have simple unchangable rules about what
>> windows receive events, but these rules produce a list and it tries
>> each in turn.
>>
>> Grabs have the unfortunate problem that the grabber cannot change
>> it's mind, and grabs must always be obscure key combinations and
>> sequences to avoid the chance that they will interfere with some
>> program.
>
> Er, grabs do have that ability: see the ReplayPointer and ReplayKeyboard
> arguments to XAllowEvents.
>
> The problem with that is that you're introducing latency: you're sending
> the event through the X server to app A, which rejects it and asks the X
> server to pass it on to app B, which rejects it and asks the X server to
> pass it on to app C, etc.  The X server is probably busy doing a million
> other things, so the latency stacks up quite badly.

The issue I have with this interface (and what I think Chase and Bill
were trying to flag here) is that in order to do any kind of "give me
the input first, just in case I need it" requires that you activate a
passive grab, which has all kinds of unintended side-effects (eg
causing LeaveNotify events all the way up the window chain, messing
with the input focus, etc etc). Many window mangers, for example, need
to do a passive grab on Button1 in order to do click raise and click
focus, but this means that every time a window is clicked, a lot of
unnecessary events get delivered to the window. This means that
clients need to add workarounds to determine whether or not they want
the input to be delivered to them in the first place, rather than
being able to deal with input on a case-by-case basis.

>
> Cheers,
> Daniel
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAk09/M0ACgkQUVYB1rKAgJTAOACcCcQ9RpameZFNUPwoBmH7vPYw
> ls0An0GOrdlXmaCucPsNqr94Uf/oVTDU
> =lQqh
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
>



-- 
Sam Spilsbury


More information about the wayland-devel mailing list