Go to index / Go to protocols

xdg_activation_v1 ↗

Protocol for requesting activation of surfaces

The way for a client to pass focus to another toplevel is as follows.

The client that intends to activate another toplevel uses the xdg_activation_v1.get_activation_token request to get an activation token. This token is then forwarded to the client, which is supposed to activate one of its surfaces, through a separate band of communication.

One established way of doing this is through the XDG_ACTIVATION_TOKEN environment variable of a newly launched child process. The child process should unset the environment variable again right after reading it out in order to avoid propagating it to other child processes.

Another established way exists for Applications implementing the D-Bus interface org.freedesktop.Application, which should get their token under activation-token on their platform_data.

In general activation tokens may be transferred across clients through means not described in this protocol.

The client to be activated will then pass the token it received to the xdg_activation_v1.activate request. The compositor can then use this token to decide how to react to the activation request.

The token the activating client gets may be ineffective either already at the time it receives it, for example if it was not focused, for focus stealing prevention. The activating client will have no way to discover the validity of the token, and may still forward it to the to be activated client.

The created activation token may optionally get information attached to it that can be used by the compositor to identify the application that we intend to activate. This can for example be used to display a visual hint about what application is being started.

Warning! The protocol described in this file is currently in the testing phase. Backward compatible changes may be added together with the corresponding interface version bump. Backward incompatible changes can only be done by creating a new major version of the extension.

xdg_activation_v1
xdg_activation_v1

Version 1
Compositor Support
Version 1
cosmic 1.0.0
hyprland 0.52.1
jay 1.14.0
kwin 6.7
labwc 0.20.2
louvre 2.14.1
mir 2.26
muffin 6.7.4
mutter 51
niri 26.04
phoc 0.55
river 0.3.13
sway 1.11
wayfire 0.9.0

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.

xdg_activation_v1
request destroy()
Destructor

    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.

    xdg_activation_v1
    request get_activation_token(
        id: new_id<xdg_activation_token_v1>,
    )

      requests a token

      Creates an xdg_activation_token_v1 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.

      xdg_activation_v1
      request activate(
          token: string,
          surface: object<wl_surface>,
      )
      • token — the activation token of the initiating client
      • surface — the wl_surface to activate

      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.

      xdg_activation_v1
      xdg_activation_token_v1

      Version 1

      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.

      xdg_activation_token_v1
      enum error {
          already_used = 0,
      }
      • already_used — The token has already been used previously
      xdg_activation_token_v1
      request set_serial(
          serial: uint,
          seat: object<wl_seat>,
      )
      • serial — the serial of the event that triggered the activation
      • seat — the wl_seat of the event

      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.

      xdg_activation_token_v1
      request set_app_id(
          app_id: string,
      )
      • app_id — the application id of the client being activated.

      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.

      xdg_activation_token_v1
      request set_surface(
          surface: object<wl_surface>,
      )
      • surface — the requesting surface

      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.

      xdg_activation_token_v1
      request commit()

        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.

        xdg_activation_token_v1
        event done(
            token: string,
        )
        • token — the exported activation token

        the exported activation token

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

        xdg_activation_token_v1
        request destroy()
        Destructor

          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.