:right-sidebar: True InputCaptureSession =================================================================== .. currentmodule:: gi.repository.Xdp .. class:: InputCaptureSession(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` A representation of a long-lived input capture portal interaction. The :obj:`~gi.repository.Xdp.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 :obj:`~gi.repository.InputCaptureSession.get_zones`\. These :obj:`~gi.repository.Xdp.InputCaptureZone` object represent the accessible desktop area for input capturing. :obj:`~gi.repository.Xdp.InputCapturePointerBarrier` objects can be set up on these zones to trigger input capture. The :obj:`~gi.repository.Xdp.InputCaptureSession` wraps a :obj:`~gi.repository.Xdp.Session` object. Methods ------- .. rst-class:: interim-class .. class:: InputCaptureSession :no-index: .. method:: 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. .. method:: disable() -> None Disables this input capture session. .. method:: enable() -> None Enables this input capture session. In the future, this client may receive input events. .. method:: get_session() -> ~gi.repository.Xdp.Session Return the :obj:`~gi.repository.Xdp.XdpSession` for this InputCapture session. .. method:: get_zones() -> list[~gi.repository.Xdp.InputCaptureZone] Obtains the current set of :obj:`~gi.repository.Xdp.InputCaptureZone` objects. The returned object is valid until the zones are invalidated by the :obj:`~gi.repository.Xdp.InputCaptureSession.signals.zones_changed` signal. Unless the session is active, this function returns ``NULL``\. .. method:: release(activation_id: int) -> None Releases this input capture session without a suggested cursor position. :param activation_id: .. method:: 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. :param activation_id: :param cursor_x_position: the suggested cursor x position once capture has been released :param cursor_y_position: the suggested cursor y position once capture has been released .. method:: set_pointer_barriers(barriers: list[~gi.repository.Xdp.InputCapturePointerBarrier], cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, data: ~typing.Any = None) -> None Sets the pointer barriers for this session. When the request is done, ``callback`` will be called. You can then call :obj:`~gi.repository.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 :obj:`~gi.repository.Xdp.InputCapturePointerBarrier.props.is_active` property is changed on that barrier. Failed barriers have the property set to a :const:`False` value. :param barriers: the pointer barriers to apply :param cancellable: :param callback: :param data: .. method:: set_pointer_barriers_finish(result: ~gi.repository.Gio.AsyncResult) -> list[~gi.repository.Xdp.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. :param result: a :obj:`~gi.repository.Gio.AsyncResult` Signals ------- .. rst-class:: interim-class .. class:: InputCaptureSession.signals :no-index: .. method:: activated(activation_id: int, options: ~gi.repository.GLib.Variant) -> None The type of the None singleton. :param activation_id: the unique activation_id to identify this input capture :param options: a GVariant with the signal options .. method:: deactivated(activation_id: int, options: ~gi.repository.GLib.Variant) -> None The type of the None singleton. :param activation_id: the unique activation_id to identify this input capture :param options: a GVariant with the signal options .. method:: disabled(options: ~gi.repository.GLib.Variant) -> None The type of the None singleton. :param options: a GVariant with the signal options .. method:: zones_changed(options: ~gi.repository.GLib.Variant) -> None The type of the None singleton. :param options: a GVariant with the signal options