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 authored and GeorgesStavracas committed Aug 4, 2023
1 parent c0f0eb1 commit 05cd5a9
Show file tree
Hide file tree
Showing 14 changed files with 3,188 additions and 0 deletions.
2 changes: 2 additions & 0 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,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 @@ -49,6 +50,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 @@ -105,6 +105,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 @@ -154,6 +155,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 05cd5a9

Please sign in to comment.