Documentation
¶
Overview ¶
Package portal is the xdg-desktop-portal client side lys-shell needs: the Request/Response handshake and the ScreenCast session the recorder captures through (wayle-recorder portal.rs, which uses ashpd).
Index ¶
Constants ¶
const ( BusName = "org.freedesktop.portal.Desktop" ObjectPath = dbus.ObjectPath("/org/freedesktop/portal/desktop") RequestIface = "org.freedesktop.portal.Request" SessionIface = "org.freedesktop.portal.Session" )
Portal bus identity.
const ( ResponseSuccess uint32 = 0 ResponseCancelled uint32 = 1 ResponseOther uint32 = 2 )
Response codes of org.freedesktop.portal.Request.Response.
const ( SourceMonitor uint32 = 1 CursorHidden uint32 = 1 CursorEmbedded uint32 = 2 PersistUntilRevoked uint32 = 2 )
ScreenCast source types, cursor modes, and persist modes (the portal's bit values).
const FileChooserIface = "org.freedesktop.portal.FileChooser"
FileChooserIface is org.freedesktop.portal.FileChooser.
const ScreenCastIface = "org.freedesktop.portal.ScreenCast"
ScreenCastIface is org.freedesktop.portal.ScreenCast.
Variables ¶
var ErrCancelled = errors.New("portal: request cancelled")
ErrCancelled is a request the user dismissed.
Functions ¶
Types ¶
type FileFilter ¶
FileFilter is one named filter of glob patterns.
type Stream ¶
type Stream struct {
// Remote is the PipeWire remote the stream plays on; the caller
// owns it and keeps it open for the capture's lifetime.
Remote *os.File
// Node is the PipeWire node id of the monitor.
Node uint32
// Width and Height are the stream size, zero when not reported.
Width, Height int32
// contains filtered or unexported fields
}
Stream is one negotiated ScreenCast stream.
func OpenScreenCast ¶
func OpenScreenCast(ctx context.Context, conn *dbus.Conn, showCursor bool, stateDir string) (*Stream, error)
OpenScreenCast is open_screencast: one monitor, the cursor embedded or hidden, persisted until revoked with the restore token kept in stateDir (so the picker shows only on the first capture). stateDir "" keeps no token.