PortalSession

class PortalSession(connection: DBusConnection)(source)

Manages session state for portals that require an active session.

Constructors

Link copied to clipboard
constructor(connection: DBusConnection)

Properties

Link copied to clipboard
var active: DBusPath?

The currently active session handle.

Functions

Link copied to clipboard
fun clear()

Clears the active session.

Link copied to clipboard
suspend fun createSession(call: (Map<String, Variant<*>>) -> DBusPath): Result<CreateSessionResponse>

Creates a new portal session using the standard CreateSession D-Bus method.

Link copied to clipboard

Returns a Flow that emits when the active session is closed.

Link copied to clipboard
fun set(path: DBusPath)

Sets the active session handle.

Link copied to clipboard
inline fun <T> withSession(block: (DBusPath) -> T): Result<T>

Executes a block with the active session, returning a Result.