Documentation
¶
Overview ¶
Package portal is lys-shell's xdg-desktop-portal backend: the org.freedesktop.impl.portal.* interfaces the compositor-independent xdg-desktop-portal frontend routes sandboxed apps' requests to, served as one object under the org.freedesktop.impl.portal.desktop.lys name that `lys-shell portal` claims. Interactive interfaces delegate their dialogs to the running shell over its own D-Bus services.
Index ¶
Constants ¶
const ( ResponseSuccess uint32 = 0 ResponseCancelled uint32 = 1 ResponseOther uint32 = 2 )
Response codes of an interactive method's (u, a{sv}) reply.
const AppearanceNS = "org.freedesktop.appearance"
AppearanceNS is the cross-desktop namespace every toolkit reads.
const BackgroundIface = "org.freedesktop.impl.portal.Background"
BackgroundIface is org.freedesktop.impl.portal.Background.
const BusName = "org.freedesktop.impl.portal.desktop.lys"
BusName is the backend's well-known name (lys-shell.portal's DBusName).
const ClipboardIface = "org.freedesktop.impl.portal.Clipboard"
ClipboardIface bridges the Wayland selection to clipboard-enabled RemoteDesktop sessions: they read the current selection, become its owner, and serve its data on demand.
const GlobalShortcutsIface = "org.freedesktop.impl.portal.GlobalShortcuts"
GlobalShortcutsIface bridges org.freedesktop.impl.portal.GlobalShortcuts to the compositor's hyprland-global-shortcuts-v1, as xdg-desktop-portal-hyprland does: shortcuts the user allows are registered there, and their presses come back as Activated / Deactivated. The compositor owns the triggers: the user binds each shortcut in its config (Hyprland's `global` dispatcher). Without the protocol nothing can be bound.
const GnomeInterfaceNS = "org.gnome.desktop.interface"
GnomeInterfaceNS is the namespace GTK's portal settings backend reads its toolkit settings from.
const InhibitIface = "org.freedesktop.impl.portal.Inhibit"
InhibitIface is org.freedesktop.impl.portal.Inhibit.
const LockdownIface = "org.freedesktop.impl.portal.Lockdown"
LockdownIface is the policy the frontend consults before allowing printing, saving, devices and so on.
const NotificationIface = "org.freedesktop.impl.portal.Notification"
NotificationIface turns portal notifications into org.freedesktop.Notifications calls the shell's daemon shows, and forwards the daemon's ActionInvoked back as the portal's. A press reaches the app as the action it named, with its target, then the platform-data holding the activation-token the daemon announced for the press (its ActivationToken), so the app can raise its window.
const ObjectPath = dbus.ObjectPath("/org/freedesktop/portal/desktop")
ObjectPath is where every interface is mounted.
const RemoteDesktopIface = "org.freedesktop.impl.portal.RemoteDesktop"
RemoteDesktopIface lets a session drive the pointer and keyboard: after the user consents, the Notify* methods and an EIS connection are replayed onto a virtual pointer and keyboard. Touch is not supported.
const RequestIface = "org.freedesktop.impl.portal.Request"
RequestIface is the object the frontend passes the handle of into every interactive method, so the app can abort it.
const ScreenCastIface = "org.freedesktop.impl.portal.ScreenCast"
ScreenCastIface is org.freedesktop.impl.portal.ScreenCast: SelectSources records the options, Start shows the shell's share picker (unless a restore token already names the source), starts a PipeWire producer per picked source and replies their node ids. The selection never leaves lys-shell, so it works on any compositor.
const SessionIface = "org.freedesktop.impl.portal.Session"
SessionIface is the object ScreenCast, RemoteDesktop, GlobalShortcuts and Inhibit monitors put at a session handle in CreateSession; it lives until the app or the backend closes it.
const SettingsIface = "org.freedesktop.impl.portal.Settings"
SettingsIface serves org.freedesktop.appearance from the live styling config, so GTK, Qt and Chromium follow lys-shell's theme, and the org.gnome.desktop.interface keys a sandboxed GTK app reads its theme, icons, cursor and font from instead of the host's settings.ini.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend is the running portal backend.
func (*Backend) Serve ¶
Serve mounts the interfaces, claims BusName (failing loudly when another backend owns it rather than queueing and idling forever) and starts the settings watcher and the notification action forwarder. The returned stop ends both, runs every live session's cleanup and drops the name.
Source Files
¶
- background.go
- clipboard.go
- clipboard_wayland.go
- dialogs.go
- email.go
- filechooser.go
- globalshortcuts.go
- inhibit.go
- lockdown.go
- logind.go
- notification.go
- portal.go
- print.go
- remotedesktop.go
- request.go
- screencast.go
- screencast_dmabuf.go
- screencast_source.go
- screencast_stream.go
- screenshot.go
- secret.go
- session.go
- settings.go
- shortcuts_wayland.go
- spawn.go
- usb.go
- vardict.go
- wallpaper.go
- wayland.go