Skip to main content

Module portal

Module portal 

Source
Expand description

xdg-desktop-portal RemoteDesktop/ScreenCast session: streams and input for hosts without the privileged Wayland protocols. xdg-desktop-portal client: one RemoteDesktop (or ScreenCast) session on the session bus that hands out the PipeWire streams of the host’s monitors and takes input events for its seat. Compositors without the privileged wlroots protocols (GNOME, KDE) expose both only this way, through their portal backend, so this is the rung host capture falls to when the registry lacks capture or virtual-input globals.

Every portal call that ends in a Response signal is made through [PortalSession::request], which subscribes to the request object the portal will answer on before calling, as the handle-token convention requires; a consent dialog the backend shows blocks that call until the user answers. Input notifications are fire-and-forget method calls, so an event never waits on the bus round trip. A restore token the backend hands back is kept under the user’s state directory, so a session reopened to change the cursor mode, and every later start on this machine, needs no second consent; a backend that hands out none (KDE) shows no dialog to an unsandboxed app in the first place.

Structs§

PortalSession
A started portal session: its streams, the devices it may drive, and the token that restores it without a dialog.
PortalStream
One monitor stream the portal started: its PipeWire node and, where the backend says, its logical position and size in the compositor’s coordinate space.

Constants§

CURSOR_EMBEDDED
CURSOR_HIDDEN
CURSOR_METADATA
DEVICE_KEYBOARD
DEVICE_POINTER

Functions§

save_restore_token
Keep a restore token for the next session (a token is single-use, so the newest replaces the one that opened this session).
saved_restore_token
The restore token saved by an earlier session, if any.