Remote DesktopπŸ”—

org.freedesktop.portal.RemoteDesktop

Portal for remote desktop sessions

The Remote desktop portal allows to create remote desktop sessions.

This documentation describes version 2 of this interface.

Session lifecycleπŸ”—

A remote desktop session is created with CreateSession(). The application then calls SelectDevices() to choose which device types to remote control (keyboard, pointer, touchscreen). Calling Start() presents a dialog to the user and, upon success, returns the set of devices granted.

Cross-portal integrationπŸ”—

A remote desktop session can be used with other portals by passing the session created here to their methods:

Input methodsπŸ”—

There are two ways to send input events to the remote desktop session:

  • EIS (recommended): Call ConnectToEIS() after starting the session to obtain a file descriptor for a libei sender context. Input events are sent via the EI protocol. Once an EIS connection is established, the Notify* D-Bus methods must not be used.

  • D-Bus Notify methods: Use the various Notify* methods (NotifyPointerMotion(), NotifyKeyboardKeycode(), etc.) to send input events over D-Bus.

Session persistenceπŸ”—

Remote desktop sessions support persistence using the persist_mode and restore_token options in SelectDevices(). Persistence for combined remote desktop and screen cast sessions is managed exclusively through this portal; the persistence options in ScreenCast.SelectSources() must not be used with a remote desktop session.

PropertiesπŸ”—

AvailableDeviceTypesπŸ”—

AvailableDeviceTypes readable u

A bitmask of available source types. Currently defined types are:

  • 1: KEYBOARD

  • 2: POINTER

  • 4: TOUCHSCREEN

versionπŸ”—

version readable u

MethodsπŸ”—

CreateSession()πŸ”—

CreateSession (
  IN options a{sv},
  OUT handle o
)

options

handle

SelectDevices()πŸ”—

SelectDevices (
  IN session_handle o,
  IN options a{sv},
  OUT handle o
)

Select input devices to remote control.

Supported keys in the options vardict include:

  • handle_token (s)

    A string that will be used as the last element of the handle. Must be a valid object path element. See the Request documentation for more information about the handle.

  • types (u)

    Bitmask of what device types to request remote controlling of. Default is all.

  • restore_token (s)

    The token to restore a previous session.

    If the stored session cannot be restored, this value is ignored and the user will be prompted normally. This may happen when, for example, the session contains a monitor or a window that is not available anymore, or when the stored permissions are withdrawn.

    The restore token is invalidated after using it once. To restore the same session again, use the new restore token sent in response to starting this session.

    This option was added in version 2 of this interface.

  • persist_mode (u)

    How this session should persist. Default is 0. Accepted values are:

    • 0: Do not persist (default)

    • 1: Permissions persist as long as the application is running

    • 2: Permissions persist until explicitly revoked

    If the permission for the session to persist is granted, a restore token will be returned via the Request::Response signal of the start method used to start the session.

    This option was added in version 2 of this interface.

For available device types, see the AvailableDeviceTypes property.

session_handle

Object path for the Session object

options

Vardict with optional further information

handle

Object path for the Request object representing this call

Start()πŸ”—

Start (
  IN session_handle o,
  IN parent_window s,
  IN options a{sv},
  OUT handle o
)

Start the remote desktop session. This will typically result in the portal presenting a dialog letting the user select what to share, including devices and optionally screen content if screen cast sources was selected.

Supported keys in the options vardict include:

  • handle_token (s)

    A string that will be used as the last element of the handle. Must be a valid object path element. See the Request documentation for more information about the handle.

The following results get returned via the Request::Response signal:

  • devices (u)

    A bitmask of the devices selected by the user.

  • clipboard_enabled (b)

    A boolean for whether the clipboard was enabled (β€˜true’) or not (β€˜false’). See the Clipboard documentation for more information. Since version 2.

  • streams (a(ua{sv}))

    An array of PipeWire streams. Each stream consists of a PipeWire node ID (the first element in the tuple, and a Vardict of properties. See ScreenCast.Start() for details.

  • restore_token (s)

    The restore token. This token is a single use token that can later be used to restore a session. See SelectDevices() for details.

    This response option was added in version 2 of this interface.

If a screen cast source was selected, the results of the ScreenCast.Start() response signal may be included.

session_handle

Object path for the Session object

parent_window

Identifier for the application window, see Window Identifiers

options

Vardict with optional further information

handle

Object path for the Request object representing this call

NotifyPointerMotion()πŸ”—

NotifyPointerMotion (
  IN session_handle o,
  IN options a{sv},
  IN dx d,
  IN dy d
)

Notify about a new relative pointer motion event. The (dx, dy) vector represents the new pointer position in the streams logical coordinate space.

session_handle

Object path for the Session object

options

Vardict with optional further information

dx

Relative movement on the x axis

dy

Relative movement on the y axis

NotifyPointerMotionAbsolute()πŸ”—

NotifyPointerMotionAbsolute (
  IN session_handle o,
  IN options a{sv},
  IN stream u,
  IN x d,
  IN y d
)

Notify about a new absolute pointer motion event. The (x, y) position represents the new pointer position in the streams logical coordinate space (see the logical_size stream property in ScreenCast).

session_handle

Object path for the Session object

options

Vardict with optional further information

stream

The PipeWire stream node the coordinate is relative to

x

Pointer motion x coordinate

y

Pointer motion y coordinate

NotifyPointerButton()πŸ”—

NotifyPointerButton (
  IN session_handle o,
  IN options a{sv},
  IN button i,
  IN state u
)

The pointer button is encoded according to Linux Evdev button codes.

May only be called if POINTER access was provided after starting the session.

Available button states:

  • 0: Released

  • 1: Pressed

session_handle

Object path for the Session object

options

Vardict with optional further information

button

The pointer button was pressed or released

state

The new state of the button

NotifyPointerAxis()πŸ”—

NotifyPointerAxis (
  IN session_handle o,
  IN options a{sv},
  IN dx d,
  IN dy d
)

The axis movement from a β€˜smooth scroll’ device, such as a touchpad. When applicable, the size of the motion delta should be equivalent to the motion vector of a pointer motion done using the same device.

May only be called if POINTER access was provided after starting the session.

Supported keys in the options vardict include:

  • finish (b)

    If set to true, this is the last axis event in a series, for example as a result of the fingers being lifted from a touchpad after a two-finger scroll. Default is false.

session_handle

Object path for the Session object

options

Vardict with optional further information

dx

Relative axis movement on the x axis

dy

Relative axis movement on the y axis

NotifyPointerAxisDiscrete()πŸ”—

NotifyPointerAxisDiscrete (
  IN session_handle o,
  IN options a{sv},
  IN axis u,
  IN steps i
)

May only be called if POINTER access was provided after starting the session.

Available axes:

  • 0: Vertical scroll

  • 1: Horizontal scroll

session_handle

Object path for the Session object

options

Vardict with optional further information

axis

The axis that was scrolled

steps

The number of steps scrolled

NotifyKeyboardKeycode()πŸ”—

NotifyKeyboardKeycode (
  IN session_handle o,
  IN options a{sv},
  IN keycode i,
  IN state u
)

May only be called if KEYBOARD access was provided after starting the session.

Available keyboard keycode states:

  • 0: Released

  • 1: Pressed

session_handle

Object path for the Session object

options

Vardict with optional further information

keycode

Keyboard code that was pressed or released

state

New state of keyboard keycode

NotifyKeyboardKeysym()πŸ”—

NotifyKeyboardKeysym (
  IN session_handle o,
  IN options a{sv},
  IN keysym i,
  IN state u
)

May only be called if KEYBOARD access was provided after starting the session.

Available keyboard keysym states:

  • 0: Released

  • 1: Pressed

session_handle

Object path for the Session object

options

Vardict with optional further information

keysym

Keyboard symbol that was pressed or released

state

New state of keyboard keysym

NotifyTouchDown()πŸ”—

NotifyTouchDown (
  IN session_handle o,
  IN options a{sv},
  IN stream u,
  IN slot u,
  IN x d,
  IN y d
)

May only be called if TOUCHSCREEN access was provided after starting the session.

Notify about a new touch down event. The (x, y) position represents the new touch point position in the streams logical coordinate space (see the logical_size stream property in ScreenCast).

session_handle

Object path for the Session object

options

Vardict with optional further information

stream

The PipeWire stream node the coordinate is relative to

slot

Touch slot where touch point appeared

x

Touch down x coordinate

y

Touch down y coordinate

NotifyTouchMotion()πŸ”—

NotifyTouchMotion (
  IN session_handle o,
  IN options a{sv},
  IN stream u,
  IN slot u,
  IN x d,
  IN y d
)

May only be called if TOUCHSCREEN access was provided after starting the session.

Notify about a new touch motion event. The (x, y) position represents where the touch point position in the streams logical coordinate space moved (see the logical_size stream property in ScreenCast).

session_handle

Object path for the Session object

options

Vardict with optional further information

stream

The PipeWire stream node the coordinate is relative to

slot

Touch slot where touch point appeared

x

Touch motion x coordinate

y

Touch motion y coordinate

NotifyTouchUp()πŸ”—

NotifyTouchUp (
  IN session_handle o,
  IN options a{sv},
  IN slot u
)

May only be called if TOUCHSCREEN access was provided after starting the session.

Notify about a new touch up event.

session_handle

Object path for the Session object

options

Vardict with optional further information

slot

Touch slot where touch point appeared

ConnectToEIS()πŸ”—

ConnectToEIS (
  IN session_handle o,
  IN options a{sv},
  OUT fd h
)

Request a connection to an EIS implementation. The returned handle can be passed to ei_setup_backend_fd() for a libei sender context to complete the connection. All information about available devices and the event flow is subject to libei. Please see the libei documentation for details.

This method may only be called once per session, where the EIS implementation disconnects the session should be closed.

This method must be called after Start()

Once an EIS connection is established, input events must be sent exclusively via the EIS connection. Any events submitted via NotifyPointerMotion(), NotifyKeyboardKeycode() and other Notify* methods will return an error.

To see how to pair a PipeWire stream with a libei device region, see the documentation for the mapping_id stream property in ScreenCast.Start().

This method was added in version 2 of this interface.

session_handle

Object path for the Session object

options

Vardict with optional further information

fd

A file descriptor to an EIS implementation that can be passed to a libei sender context