Some of my thoughts on input for wayland
krh at bitplanet.net
Mon Jan 24 18:18:10 PST 2011
On Mon, Jan 24, 2011 at 4:04 PM, Bill Spitzak <spitzak at gmail.com> 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.
Wayland isn't going to support passive grabs. They're essentially
only used for global keybindings and some window manager behaviour
such as Alt-Click to move a window. Since the window manager is the
display server, the window manager can just look for the input
combinations that would trigger a grab in the X model and handle them
internally. Applications will want to install keybindings (like a
media player that wants to handle the media keys) but that's already
handled by the window manager or a desktop daemon. Applications
install a config file in a keybindings.d type directory read by the
window manager or install into a well defined gconf directory or
something along those lines.
I expect gesture recognition will work much the same way. The
compositor gets the input events before anybody else and can decide
whether it's a global gesture and keep the events to itself or to
forward them to the application. There is no window hierarchy, so
once the compositor decides to send the events to a certain events to
a surface, that's where they go. There is no event propagation or
bubbling going on (except what the client may implement internally in
its window), there is on need to reject the events or pass them on to
another client or back to the compositor.
More information about the wayland-devel