Skip to content

xdg_activation_token_v1¤

wayland.xdg_activation_token_v1 ¤

An exported activation handle

An object for setting up a token and receiving a token handle that can be passed as an activation token to another client.

The object is created using the xdg_activation_v1.get_activation_token request. This object should then be populated with the app_id, surface and serial information and committed. The compositor shall then issue a done event with the token. In case the request's parameters are invalid, the compositor will provide an invalid token.

Methods:

  • set_serial

    Specifies the seat and serial of the activating event

  • set_app_id

    Specifies the application being activated

  • set_surface

    Specifies the surface requesting activation

  • commit

    Issues the token request

  • destroy

    Destroy the xdg_activation_token_v1 object

  • on_done

    The exported activation token.

error ¤

events

done ¤

done(token: str) -> None

The exported activation token

The 'done' event contains the unique token of this activation request and notifies that the provider is done.

Parameters:

  • token ¤

    (str) –

    The exported activation token

set_serial ¤

set_serial(serial: int, seat: wl_seat) -> None

Specifies the seat and serial of the activating event

Provides information about the seat and serial event that requested the token.

The serial can come from an input or focus event. For instance, if a click triggers the launch of a third-party client, the launcher client should send a set_serial request with the serial and seat from the wl_pointer.button event.

Some compositors might refuse to activate toplevels when the token doesn't have a valid and recent enough event serial.

Must be sent before commit. This information is optional.

Parameters:

  • serial ¤

    (int) –

    The serial of the event that triggered the activation

  • seat ¤

    (wl_seat) –

    The wl_seat of the event

set_app_id ¤

set_app_id(app_id: str) -> None

Specifies the application being activated

The requesting client can specify an app_id to associate the token being created with it.

Must be sent before commit. This information is optional.

Parameters:

  • app_id ¤

    (str) –

    The application id of the client being activated.

set_surface ¤

set_surface(surface: wl_surface) -> None

Specifies the surface requesting activation

This request sets the surface requesting the activation. Note, this is different from the surface that will be activated.

Some compositors might refuse to activate toplevels when the token doesn't have a requesting surface.

Must be sent before commit. This information is optional.

Parameters:

commit ¤

commit() -> None

Issues the token request

Requests an activation token based on the different parameters that have been offered through set_serial, set_surface and set_app_id.

destroy ¤

destroy() -> None

Destroy the xdg_activation_token_v1 object

Notify the compositor that the xdg_activation_token_v1 object will no longer be used. The received token stays valid.

on_done ¤

on_done(token: str) -> None

The exported activation token.

Override to handle wayland.xdg_activation_token_v1.events.done.