xdg_activation_v1 Module

XdgActivationTokenV1

class pywayland.protocol.xdg_activation_v1.XdgActivationTokenV1

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 XdgActivationV1.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.

set_serial(serial: 'int', seat: 'WlSeat') → 'None'

Request – opcode 0 (attached to Resource instance)

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 WlPointer.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 (ArgumentType.Uint) – the serial of the event that triggered the activation
  • seat (WlSeat) – the WlSeat of the event
set_app_id(app_id: 'str') → 'None'

Request – opcode 1 (attached to Resource instance)

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 (ArgumentType.String) – the application id of the client being activated.
set_surface(surface: 'WlSurface') → 'None'

Request – opcode 2 (attached to Resource instance)

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:surface (WlSurface) – the requesting surface
commit() → 'None'

Request – opcode 3 (attached to Resource instance)

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() → 'None'

Request – opcode 4 (attached to Resource instance)

Destroy the XdgActivationTokenV1 object

Notify the compositor that the XdgActivationTokenV1 object will no longer be used.

done(token: 'str') → 'None'

Event – opcode 0 (attached to Proxy instance)

The exported activation token

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

Parameters:token (ArgumentType.String) – the exported activation token

XdgActivationV1

class pywayland.protocol.xdg_activation_v1.XdgActivationV1

Interface for activating surfaces

A global interface used for informing the compositor about applications being activated or started, or for applications to request to be activated.

destroy() → 'None'

Request – opcode 0 (attached to Resource instance)

Destroy the xdg_activation object

Notify the compositor that the xdg_activation object will no longer be used.

The child objects created via this interface are unaffected and should be destroyed separately.

get_activation_token() → 'Proxy[XdgActivationTokenV1]'

Request – opcode 1 (attached to Resource instance)

Requests a token

Creates an XdgActivationTokenV1 object that will provide the initiating client with a unique token for this activation. This token should be offered to the clients to be activated.

Returns:XdgActivationTokenV1
activate(token: 'str', surface: 'WlSurface') → 'None'

Request – opcode 2 (attached to Resource instance)

Notify new interaction being available

Requests surface activation. It’s up to the compositor to display this information as desired, for example by placing the surface above the rest.

The compositor may know who requested this by checking the activation token and might decide not to follow through with the activation if it’s considered unwanted.

Compositors can ignore unknown activation tokens when an invalid token is passed.

Parameters:
  • token (ArgumentType.String) – the activation token of the initiating client
  • surface (WlSurface) – the WlSurface to activate