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 go to an input thread of the session’s own, so no
caller waits on the bus round trip, and it makes each once the one before it is answered: the
frontend handles every method call on a thread pool, so two in flight together reach the
backend in either order (a click’s release before its press, which leaves the button held).
Each public call runs its async zbus calls to completion with
[zbus::block_on] on the calling thread; between calls zbus drives the connection from a
helper thread of its own, so a Response that lands meanwhile is queued for the stream that
subscribed to it. 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§
- Portal
Session - A started portal session: its streams, the devices it may drive, and the token that restores it without a dialog.
- Portal
Stream - 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 - DESKTOP 🔒
- DESKTOP_
PATH 🔒 - DEVICE_
KEYBOARD - DEVICE_
POINTER - MOTION_
ABSOLUTE 🔒 - PERSIST_
UNTIL_ 🔒REVOKED - REMOTE_
DESKTOP_ 🔒IFACE - REQUEST_
IFACE 🔒 - SCREENCAST_
IFACE 🔒 - SESSION_
IFACE 🔒 - SOURCE_
MONITOR 🔒
Functions§
- name_
owned 🔒 - Whether
namehas an owner on the busconnis on. - next_
message 🔒 - The next message of
stream, orNoneonce it ends. - notify_
loop 🔒 - The input thread: each
Notify*call once the one before it is answered, an absolute motion with another queued behind it left out; it ends with the session’s queue. - opt_u32 🔒
- parse_
streams 🔒 - The
a(ua{sv})stream list of aStartresponse. - request_
path 🔒 - The request object the portal answers a call from
senderwithtokenon. - 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.
- sound_
path 🔒 - Whether
pathis absolute and free of..: the XDG Base Directory specification has a relative path in its variables ignored. - token_
path 🔒 - Where the portal’s restore token lives between runs:
$XDG_STATE_HOME/pixelflux, or~/.local/state/pixelfluxwhere that is unset or not absolute. - value_
i32 🔒 - value_
pair 🔒
Type Aliases§
- Notify
Call 🔒 - A
Notify*method for the input thread, and the call that makes it. - Options 🔒