[PATCH wayland-protocols v5 1/2] Introduce keyboard grabbing protocol for Xwayland

Olivier Fourdan ofourdan at redhat.com
Fri Jun 30 13:41:51 UTC 2017


Hi Jonas,

> > [...]
> > +
> > +    <request name="grab_keyboard">
> > +      <description summary="grab the keyboard to a surface">
> > +	The grab_keyboard request asks for a grab of the keyboard,
> > +	effectively reporting all key events to a surface.
> 
> I can't seem to find where "grab" is defined. Normally in other Wayland
> protocols, a "grab" means locking keyboard/pointer/touch focus on a
> certain focus, but reading the above specification, it sounds rather
> like here a "grab" doesn't affect keyboard focus, but rather where
> keyboard events are sent.
> 
> So, does this grab lock the keyboard focus on the given surface? Or
> should the compositor simply ignore the keyboard focus when routing
> events? If it's the latter, how would the client (Xwayland) know about
> pressed keys and things like that that comes with a wl_keyboard.enter
> event?

That would be the former, the compositor forces the keyboard focus onto the given surface.

In mutter terms, for example, it does a:

  meta_wayland_keyboard_set_focus (keyboard, active_grab->surface);

in the MetaWaylandKeyboardGrabInterface's "grab_keyboard_key" handler.

Cheers,
Olivier


More information about the wayland-devel mailing list