Xdp.Session¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when a session is closed externally. |
Fields¶
- Inherited:
Class Details¶
- class Xdp.Session(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A representation of long-lived screencast portal interactions.
The
Xdp.Session
object is used to represent portal interactions with the screencast or remote desktop portals that extend over multiple portal calls.To find out what kind of session an
Xdp.Session
object represents and whether it is still active, you can use [method`Session`.get_session_type] and [method`Session`.get_session_state].All sessions start in an initial state. They can be made active by calling [method`Session`.start], and ended by calling [method`Session`.close].
- close()¶
Closes the session.
- connect_to_eis()¶
- Raises:
- Returns:
the file descriptor to the EIS implementation
- Return type:
Connect this XdpRemoteDesktopSession to an EIS implementation and return the fd. This fd can be passed into ei_setup_backend_fd(). See the libei documentation for details.
This call must be issued before
Xdp.Session.start
(). If successful, all input event emulation must be handled via the EIS connection and calls toXdp.Session.pointer_motion
() etc. are silently ignored.
- get_devices()¶
- Returns:
the selected devices
- Return type:
Obtains the devices that the user selected.
Unless the session is active, this function returns
XDP_DEVICE_NONE
.
- get_persist_mode()¶
- Returns:
the effective persist mode of self
- Return type:
Retrieves the effective persist mode of self.
May only be called after self is successfully started, i.e. after [method`Session`.start_finish].
- get_restore_token()¶
-
Retrieves the restore token of self.
A restore token will only be available if
XDP_PERSIST_MODE_TRANSIENT
orXDP_PERSIST_MODE_PERSISTENT
was passed when creating the screencast session.Remote desktop sessions cannot be restored.
May only be called after self is successfully started, i.e. after [method`Session`.start_finish].
- get_session_state()¶
- Returns:
the state of self
- Return type:
Obtains information about the state of the session that is represented by self.
- get_session_type()¶
- Returns:
the type of self
- Return type:
Obtains information about the type of session that is represented by self.
- get_streams()¶
- Returns:
the selected streams
- Return type:
Obtains the streams that the user selected.
The information in the returned [struct`GLib`.Variant] has the format
a(ua{sv})
. Each item in the array is describing a stream. The first member is the pipewire node ID, the second is a dictionary of stream properties, including:position,
(ii)
: a tuple consisting of the position(x, y)
in the compositor coordinate space. Note that the position may not be equivalent to a position in a pixel coordinate space. Only available for monitor streams.size,
(ii)
: a tuple consisting of (width, height). The size represents the size of the stream as it is displayed in the compositor coordinate space. Note that this size may not be equivalent to a size in a pixel coordinate space. The size may differ from the size of the stream.
Unless the session is active, this function returns
NULL
.
- keyboard_key(keysym, key, state)¶
- Parameters:
keysym (
bool
) – whether to interpret key as a keysym instead of a keycodekey (
int
) – the keysym or keycode to changestate (
Xdp.KeyState
) – the new state
Changes the state of the key to state.
May only be called on a remote desktop session with
XDP_DEVICE_KEYBOARD
access.
- open_pipewire_remote()¶
- Returns:
the file descriptor
- Return type:
Opens a file descriptor to the pipewire remote where the screencast streams are available.
The file descriptor should be used to create a pw_remote object, by using pw_remote_connect_fd(). Only the screencast stream nodes will be available from this pipewire node.
- pointer_axis(finish, dx, dy)¶
- Parameters:
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 advice.
May only be called on a remote desktop session with
XDP_DEVICE_POINTER
access.
- pointer_axis_discrete(axis, steps)¶
- Parameters:
axis (
Xdp.DiscreteAxis
) – the axis to changesteps (
int
) – number of steps scrolled
The axis movement from a discrete scroll device.
May only be called on a remote desktop session with
XDP_DEVICE_POINTER
access.
- pointer_button(button, state)¶
- Parameters:
button (
int
) – the buttonstate (
Xdp.ButtonState
) – the new state
Changes the state of the button to state.
May only be called on a remote desktop session with
XDP_DEVICE_POINTER
access.
- pointer_motion(dx, dy)¶
-
Moves the pointer from its current position.
May only be called on a remote desktop session with
XDP_DEVICE_POINTER
access.
- pointer_position(stream, x, y)¶
- Parameters:
Moves the pointer to a new position in the given streams logical coordinate space.
May only be called on a remote desktop session with
XDP_DEVICE_POINTER
access.
- start(parent, cancellable, callback, *data)¶
- Parameters:
parent (
Xdp.Parent
orNone
) – parent window informationcancellable (
Gio.Cancellable
orNone
) – optional [class`Gio`.Cancellable]callback (
Gio.AsyncReadyCallback
orNone
) – a callback to call when the request is done
Starts the session.
When the request is done, callback will be called. You can then call [method`Session`.start_finish] to get the results.
- start_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – a [iface`Gio`.AsyncResult]- Raises:
- Returns:
TRUE
if the session was started successfully.- Return type:
Finishes the session-start request.
- touch_down(stream, slot, x, y)¶
- Parameters:
Notify about a new touch down event.
The
(x, y)
position represents the new touch point position in the streams logical coordinate space.May only be called on a remote desktop session with
XDP_DEVICE_TOUCHSCREEN
access.
- touch_position(stream, slot, x, y)¶
- Parameters:
Notify about a new touch motion event.
The
(x, y)
position represents where the touch point position in the streams logical coordinate space moved.May only be called on a remote desktop session with
XDP_DEVICE_TOUCHSCREEN
access.
Signal Details¶
- Xdp.Session.signals.closed(session)¶
- Signal Name:
closed
- Flags:
- Parameters:
session (
Xdp.Session
) – The object which received the signal
Emitted when a session is closed externally.