InputCaptureSession#
Superclasses: Object
A representation of a long-lived input capture portal interaction.
The 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 get_zones.
These InputCaptureZone object represent the accessible desktop area
for input capturing. InputCapturePointerBarrier objects can be set
up on these zones to trigger input capture.
The InputCaptureSession wraps a Session object.
Methods#
- class InputCaptureSession
- connect_to_eis() int#
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.
- enable() None#
Enables this input capture session. In the future, this client may receive input events.
- get_zones() list[InputCaptureZone]#
Obtains the current set of
InputCaptureZoneobjects.The returned object is valid until the zones are invalidated by the
zones_changedsignal.Unless the session is active, this function returns
NULL.
- release(activation_id: int) None#
Releases this input capture session without a suggested cursor position.
- Parameters:
activation_id
- release_at(activation_id: int, cursor_x_position: float, cursor_y_position: float) None#
Releases this input capture session with a suggested cursor position. Note that the implementation is not required to honour this position.
- Parameters:
activation_id
cursor_x_position – the suggested cursor x position once capture has been released
cursor_y_position – the suggested cursor y position once capture has been released
- async set_pointer_barriers(self, barriers: list[InputCapturePointerBarrier]) list[InputCapturePointerBarrier]#
This is the awaitable version of
set_pointer_barriers().- Parameters:
barriers – the pointer barriers to apply
- set_pointer_barriers(barriers: list[InputCapturePointerBarrier], cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, data: Any = None) None#
Sets the pointer barriers for this session. When the request is done,
callbackwill be called. You can then callset_pointer_barriers_finishto 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
is_activeproperty is changed on that barrier. Failed barriers have the property set to aFalsevalue.- Parameters:
barriers – the pointer barriers to apply
cancellable
callback
data
- set_pointer_barriers_finish(result: AsyncResult) list[InputCapturePointerBarrier]#
Finishes the set-pointer-barriers request, and returns a GList with the pointer barriers that failed to apply and should be cleaned up by the caller.
- Parameters:
result – a
AsyncResult
Signals#
- class InputCaptureSession.signals
- activated(activation_id: int, options: Variant) None#
The type of the None singleton.
- Parameters:
activation_id – the unique activation_id to identify this input capture
options – a GVariant with the signal options
- deactivated(activation_id: int, options: Variant) None#
The type of the None singleton.
- Parameters:
activation_id – the unique activation_id to identify this input capture
options – a GVariant with the signal options