Xdp.InputCaptureSession¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when an InputCapture session activates and sends events. |
|
Emitted when an InputCapture session deactivates and no longer sends events. |
|
Emitted when an InputCapture session is disabled. |
|
Emitted when an InputCapture session’s zones have changed. |
Fields¶
- Inherited:
Class Details¶
- class Xdp.InputCaptureSession(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A representation of a long-lived input capture portal interaction.
The [class`InputCaptureSession`] object is used to represent portal interactions with the input capture desktop portal that extend over multiple portal calls. Usually a caller creates an input capture session, requests the available zones and sets up pointer barriers on those zones before enabling the session.
To find available zones, call [method`InputCaptureSession`.get_zones]. These [class`InputCaptureZone`] object represent the accessible desktop area for input capturing. [class`InputCapturePointerBarrier`] objects can be set up on these zones to trigger input capture.
The [class`InputCaptureSession`] wraps a [class`Session`] object.
- connect_to_eis()¶
- Raises:
- Returns:
a socket to the EIS implementation for this input capture session or a negative errno on failure.
- Return type:
Connect this session 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 is a sync DBus invocation.
- disable()¶
Disables this input capture session.
- enable()¶
Enables this input capture session. In the future, this client may receive input events.
- get_session()¶
- Returns:
a [class`Session`] object
- Return type:
Return the [class`XdpSession`] for this InputCapture session.
- get_zones()¶
- Returns:
the available zones. The caller must keep a reference to the list or the elements if used outside the immediate scope.
- Return type:
Obtains the current set of [class`InputCaptureZone`] objects.
The returned object is valid until the zones are invalidated by the [signal`InputCaptureSession`:py:func:::zones-changed<Xdp.InputCaptureSession.signals.zones_changed>] signal.
Unless the session is active, this function returns
NULL
.
- release(activation_id)¶
- Parameters:
activation_id (
int
) –
Releases this input capture session without a suggested cursor position.
- release_at(activation_id, cursor_x_position, cursor_y_position)¶
- Parameters:
Releases this input capture session with a suggested cursor position. Note that the implementation is not required to honour this position.
- set_pointer_barriers(barriers, cancellable, callback, *data)¶
- Parameters:
barriers ([
Xdp.InputCapturePointerBarrier
]) – the pointer barriers to applycancellable (
Gio.Cancellable
orNone
) –callback (
Gio.AsyncReadyCallback
orNone
) –
Sets the pointer barriers for this session. When the request is done, callback will be called. You can then call [method`InputCaptureSession`.set_pointer_barriers_finish] to get the results. The result of this request is the list of pointer barriers that failed to apply - barriers not present in the returned list are active.
Once the pointer barrier is applied (i.e. the reply to the DBus Request has been received), the the [property`InputCapturePointerBarrier`:py:data::is-active<Xdp.InputCaptureSession.props.is_active>] property is changed on that barrier. Failed barriers have the property set to a
False
value.
- set_pointer_barriers_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – a [iface`Gio`.AsyncResult]- Raises:
- Returns:
a list of failed pointer barriers
- Return type:
Finishes the set-pointer-barriers request, and returns a
GLib.List
with the pointer barriers that failed to apply and should be cleaned up by the caller.
Signal Details¶
- Xdp.InputCaptureSession.signals.activated(input_capture_session, activation_id, options)¶
- Signal Name:
activated
- Flags:
- Parameters:
input_capture_session (
Xdp.InputCaptureSession
) – The object which received the signalactivation_id (
int
) – the unique activation_id to identify this input captureoptions (
GLib.Variant
) – aGLib.Variant
with the signal options
Emitted when an InputCapture session activates and sends events. When this signal is emitted, events will appear on the transport layer.
- Xdp.InputCaptureSession.signals.deactivated(input_capture_session, activation_id, options)¶
- Signal Name:
deactivated
- Flags:
- Parameters:
input_capture_session (
Xdp.InputCaptureSession
) – The object which received the signalactivation_id (
int
) – the unique activation_id to identify this input captureoptions (
GLib.Variant
) – aGLib.Variant
with the signal options
Emitted when an InputCapture session deactivates and no longer sends events.
- Xdp.InputCaptureSession.signals.disabled(input_capture_session, options)¶
- Signal Name:
disabled
- Flags:
- Parameters:
input_capture_session (
Xdp.InputCaptureSession
) – The object which received the signaloptions (
GLib.Variant
) – aGLib.Variant
with the signal options
Emitted when an InputCapture session is disabled. This signal is emitted when capturing was disabled by the server.
- Xdp.InputCaptureSession.signals.zones_changed(input_capture_session, options)¶
- Signal Name:
zones-changed
- Flags:
- Parameters:
input_capture_session (
Xdp.InputCaptureSession
) – The object which received the signaloptions (
GLib.Variant
) – aGLib.Variant
with the signal options
Emitted when an InputCapture session’s zones have changed. When this signal is emitted, all current zones will have their [property`InputCaptureZone`:py:data::is-valid<Xdp.InputCaptureSession.props.is_valid>] property set to
False
and all internal references to those zones have been released. This signal is sent after libportal has fetched the updated zones, a caller should callXdp.InputCaptureSession.get_zones
() to retrieve the new zones.