Skip to content

Commit

Permalink
Add the InputCapture portal
Browse files Browse the repository at this point in the history
This portal is aimed at allowing applications to capture input from
physical devices, the prime use case is the server component of an
InputLeap (a Synergy fork) setup where local devices are used to control
a remote display.

The general flow for the InputCapture session is:
- application queries the "zones" available (usually representing the
  desktop)
- application sets up "pointer barriers"
- application provides a libei-compatible handle for the actual input
  events
- when a cursor moves against/across a pointer barrier, the compositor
  notifies the client and re-routes input events from libinput to libei
  instead of controlling the local cursor

Notable: the actual input events are not part of the portal here,
they're handled by the direct libei connection between compositor and
application. This portal has no direct dependencies on libei itself.

The compositor is in charge of everything - it can restrict some screens
from showing up in the regions, it can deny pointer barriers at
locations, it decides when a pointer barrier is crossed, it can stop
capturing (or filter events) at any time, etc.
  • Loading branch information
whot committed May 22, 2023
1 parent eeae17a commit b5d768f
Show file tree
Hide file tree
Showing 12 changed files with 3,167 additions and 1 deletion.
2 changes: 2 additions & 0 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ portal_sources = files(
'org.freedesktop.portal.GameMode.xml',
'org.freedesktop.portal.GlobalShortcuts.xml',
'org.freedesktop.portal.Inhibit.xml',
'org.freedesktop.portal.InputCapture.xml',
'org.freedesktop.portal.Location.xml',
'org.freedesktop.portal.MemoryMonitor.xml',
'org.freedesktop.portal.NetworkMonitor.xml',
Expand Down Expand Up @@ -47,6 +48,7 @@ portal_impl_sources = files(
'org.freedesktop.impl.portal.FileChooser.xml',
'org.freedesktop.impl.portal.GlobalShortcuts.xml',
'org.freedesktop.impl.portal.Inhibit.xml',
'org.freedesktop.impl.portal.InputCapture.xml',
'org.freedesktop.impl.portal.Lockdown.xml',
'org.freedesktop.impl.portal.Notification.xml',
'org.freedesktop.impl.portal.PermissionStore.xml',
Expand Down
436 changes: 436 additions & 0 deletions data/org.freedesktop.impl.portal.InputCapture.xml

Large diffs are not rendered by default.

587 changes: 587 additions & 0 deletions data/org.freedesktop.portal.InputCapture.xml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions doc/portal-docs.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
<xi:include href="portal-org.freedesktop.portal.GameMode.xml"/>
<xi:include href="portal-org.freedesktop.portal.GlobalShortcuts.xml"/>
<xi:include href="portal-org.freedesktop.portal.Inhibit.xml"/>
<xi:include href="portal-org.freedesktop.portal.InputCapture.xml"/>
<xi:include href="portal-org.freedesktop.portal.Location.xml"/>
<xi:include href="portal-org.freedesktop.portal.MemoryMonitor.xml"/>
<xi:include href="portal-org.freedesktop.portal.NetworkMonitor.xml"/>
Expand Down Expand Up @@ -152,6 +153,7 @@
<xi:include href="portal-org.freedesktop.impl.portal.FileChooser.xml"/>
<xi:include href="portal-org.freedesktop.impl.portal.GlobalShortcuts.xml"/>
<xi:include href="portal-org.freedesktop.impl.portal.Inhibit.xml"/>
<xi:include href="portal-org.freedesktop.impl.portal.InputCapture.xml"/>
<xi:include href="portal-org.freedesktop.impl.portal.Lockdown.xml"/>
<xi:include href="portal-org.freedesktop.impl.portal.Notification.xml"/>
<xi:include href="portal-org.freedesktop.impl.portal.PermissionStore.xml"/>
Expand Down
Loading

0 comments on commit b5d768f

Please sign in to comment.