Skip to content

Draft: Introduce input capturing

Jonas Ådahl requested to merge jadahl/mutter:wip/input-capture into main

This merge request introduces input capturing. It's meant to be primarily used via from the InputCapture portal via the backend in xdg-desktop-portal-gnome.

What it enables is for applications to start capturing input events when the mouse pointer crosses a set up barrier. Actual input is transmitted using libei. libei has not reached API stability yet, and this MR should not be merged until it has.

The way it works, more or less, is an application receives a set of "zones" that correspond to the monitor layout in a logical pixel grid. Along the outer edges of the union of these "zones", the application is allowed to create pointer motion barriers that when hit, will activate input capturing.

When input capturing is activated, selected input events (pointer motions, keyboard events) are transmitted to the application via libei, until the application decides not to, or if the user presses the a binding that cancels the capture session (default us SuperShiftEsc, being similar to the default for cancelling the inhibit shortcut key binding (SuperEsc)).

Some things that probably needs some decisions or more work:

  • Input capturing is using the same methods for letting GNOME Shell know about "remote access" as screen casting and remote desktop, meaning that the same "screen is shared" indicator will probably show (haven't tested). This needs design decision how to present this.
  • What do with popups - should they be dismissed when capturing is activated? What about other grabs?
  • Haven't really tried this on X11 yet, but should probably make some sort of "best effort" implementation, even though it's unlikely to be on the same level as the one in the Wayland session.

Cc: @whot

Includes !2391 (merged).

Edited by Jonas Ådahl

Merge request reports