xdg_decoration_v1

toplevel decoration manager

This interface allows a compositor to announce support for one or more types of decorations.

Window decorations are a set of window controls as deemed appropriate by the party managing them, such as user interface components used to move, resize and change a toplevel surface's state, drop shadows, and other visual styling around a toplevel.

A client can use this protocol to request being decorated by a supporting compositor.

If compositor and client do not negotiate the use of any type of decoration using this protocol, clients continue to self-decorate as they see fit.

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.

destroy()
destroy the decoration manager object

Destroy the decoration manager. This doesn't destroy objects created with the manager.

get_toplevel_decoration(id: new_id<xdg_toplevel_decoration_v1>, toplevel: object<xdg_toplevel>)
Argument
Type
Description
idnew_id<xdg_toplevel_decoration_v1>
toplevelobject<xdg_toplevel>
create a new toplevel decoration object

Create a new decoration object associated with the given toplevel.

Creating an xdg_toplevel_decoration from an xdg_toplevel which has a buffer attached is a client error.


decoration object for a toplevel surface

The decoration object allows the compositor to toggle server-side toplevel decorations for a toplevel surface. The client can request to switch to another mode.

The xdg_toplevel_decoration object must be destroyed before its xdg_toplevel.

destroy()
destroy the decoration object

Destroys this object, and switches back to a mode without any server-side decorations at the next commit. The client will draw decorations as it sees fit.

The xdg_toplevel_decoration object must be destroyed before its xdg_toplevel.

Argument
Type
Description
decoration_draweruint<xdg_toplevel_decoration_v1.mode>
who should draw decorations
capabilitiesuint<xdg_toplevel_decoration_v1.decorations>
combination of decorations values
set decorations the client supports

Set the toplevel surface decoration mode. This informs the compositor that the client would like to be drawn in the provided decoration mode, and if specified, which decorations should be drawn by the compositor.

If the decoration_drawer argument is "client", the capabilities argument is used to hint to the compositor which decorations are drawn by the client.

If the decoration_drawer argument is "server", the capabilities argument must only contain valid arguments (sent in a previous decoration_capabilities event) or zero, and the compositor will draw those decorations on behalf of the client.

Clients whose decoration mode depend on the xdg_toplevel state may send a set_decorations request in response to an xdg_surface.configure event and wait for the next xdg_surface.configure event to prevent unwanted state. Such clients are responsible for preventing configure loops and must make sure not to send multiple successive set_decorations requests with the same decoration mode.

If an invalid or unknown mode is supplied by the client, the invalid_mode protocol error is raised by the compositor.

Argument
Type
Description
supported_decoration_draweruint<xdg_toplevel_decoration_v1.mode>
non-zero if server supports decorations drawn by the server
decorationsuint<xdg_toplevel_decoration_v1.decorations>
combination of decorations values
compositor capabilities

This event will be always be sent once with the "client" supported_decoration_drawer argument, and will be accompanied by a second decoration_capabilities event with a "server" supported_decoration_drawer argument, if supported by the compositor.

If this event is ever sent without an accompanying "server" event type, including after object creation, the client must not request server-drawn decorations, nor commit any new state using server-drawn decorations, otherwise it will raise the invalid_mode error.

See the set_decorations request for how to signal which decoration mode the client would like, and which decorations the client would like to have drawn for it.

This event may be sent several times over the lifetime of xdg_toplevel_decoration object, each time (including the initial event) with an xdg_surface::configure event; clients must re-configure themselves with the new described modes before committing their state, otherwise an invalid_mode error is raised by the compositor.

Argument
Value
Description
unconfigured_buffer0
xdg_toplevel has a buffer attached before configure
already_constructed1
xdg_toplevel already has a decoration object
orphaned2
xdg_toplevel destroyed before the decoration object
invalid_mode3
invalid mode
Argument
Value
Description
client_side1
no server-side toplevel decorations
server_side2
server-side toplevel decorations
toplevel decoration modes

These values describe toplevel decoration modes.

decorations { zero, drop_shadows, any_decorations } 
Argument
Value
Description
zero0x0
a zeroed bitfield
drop_shadows0x1
drop shadows
any_decorations0x2147483648
any type of decorations

Compositor Support

No compositor support found

Copyright © 2018 Simon Ser Copyright © 2025 Dallas Strouse Copyright © 2025 Neal Gompa

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.