xdg_decoration_unstable_v1

window decoration manager

This interface allows a compositor to announce support for server-side decorations.

A window decoration is 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 window's state.

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

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

Warning! The protocol described in this file is experimental and backward incompatible changes may be made. Backward compatible changes may be added together with the corresponding interface version bump. Backward incompatible changes are done by bumping the version number in the protocol and interface names and resetting the interface version. Once the protocol is to be declared stable, the 'z' prefix and the version number in the protocol and interface names are removed and the interface version number is reset.

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<zxdg_toplevel_decoration_v1>, toplevel: object<xdg_toplevel>)
Argument
Type
Description
idnew_id<zxdg_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 or committed is a client error, and any attempts by a client to attach or manipulate a buffer prior to the first xdg_toplevel_decoration.configure event must also be treated as errors.


decoration object for a toplevel surface

The decoration object allows the compositor to toggle server-side window 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

Switch back to a mode without any server-side decorations at the next commit.

Argument
Type
Description
modeuint<zxdg_toplevel_decoration_v1.mode>
the decoration mode
set the decoration mode

Set the toplevel surface decoration mode. This informs the compositor that the client prefers the provided decoration mode.

After requesting a decoration mode, the compositor will respond by emitting an xdg_surface.configure event. The client should then update its content, drawing it without decorations if the received mode is server-side decorations. The client must also acknowledge the configure when committing the new content (see xdg_surface.ack_configure).

The compositor may decide not to use the client's mode and enforce a different mode instead. Compositors must not use notch_server_side unless the client has requested it.

Clients whose decoration mode depend on the xdg_toplevel state may send a set_mode 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_mode requests with the same decoration mode.

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

unset_mode()
unset the decoration mode

Unset the toplevel surface decoration mode. This informs the compositor that the client doesn't prefer a particular decoration mode.

This request has the same semantics as set_mode.

notch_set_padding(edge: uint<zxdg_toplevel_decoration_v1.edge>, size: uint)
Argument
Type
Description
edgeuint<zxdg_toplevel_decoration_v1.edge>
the edge of the window
sizeuint
size of the prefered padding
set prefered padding

Set the decoration prefered size. This informs the compositor that the client prefers the provided size of decorations on the provided edge of the window.

If the client does not wish to visually integrate with the decorations on a particular edge of the window, it may set the size to 0. If the padding on a particular edge is set to 0, the compositor should not overlay decorations that are intended to integrate with that edge of the window.

The compositor may decide to not use the clients prefered decoration size and use a different size instead.

Clients must only send this request in notch_server_side mode.

If an invalid edge is provided by the client, the invalid_edge protocol error is raised by the compositor.

notch_unset_padding(edge: uint<zxdg_toplevel_decoration_v1.edge>)
Argument
Type
Description
edgeuint<zxdg_toplevel_decoration_v1.edge>
the edge of the window
unset prefered padding

Unset the prefered padding. This informs the compositor that the client doesn't have a prefered padding size on the provided edge of the window.

This request has the same semantics as notch_set_padding

Argument
Type
Description
modeuint<zxdg_toplevel_decoration_v1.mode>
the decoration mode
notify a decoration mode change

The configure event configures the effective decoration mode. The configured state should not be applied immediately. Clients must send an ack_configure in response to this event. See xdg_surface.configure and xdg_surface.ack_configure for details.

A configure event can be sent at any time. The specified mode must be obeyed by the client.

configure_decoration(position: uint<zxdg_toplevel_decoration_v1.position>, width: uint, height: uint)
Argument
Type
Description
positionuint<zxdg_toplevel_decoration_v1.position>
position of the decoration
widthuint
width of the decoration
heightuint
height of the decoration
notify a decoration configuration change

The configure decoration event configures the size and position of notched server size decorations. The configured state should not be applied immediately. Clients must send an ack_configure in response to this event. See xdg_surface.configure and xdg_surface.ack_configure for details.

A configure decoration event can be sent at any time while in notch_server_side mode.

Clients should create visually empty space in the area of a notched decoration. Clients should treat the values as already having all the visual padding needed for the decorations to appear centered.

Compositors may use more than 1 position for decorations. Compositors may remove decorations by setting the width and height to 0. Compositors must not include a decoration if the decoration will not be overlayed onto the client.

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
invalid_edge4
invalid edge
invalid_position5
invalid position
Argument
Value
Description
client_side1
no server-side window decoration
server_side2
server-side window decoration
notch_server_side3
notched server-side window decoration
window decoration modes

These values describe window decoration modes.

edge { top, bottom, left, right } 
Argument
Value
Description
top1
bottom2
left3
right4
window edges

These values describe the edge of a window.


Compositor Support

Mutter
Mutter
47.3
KWin
KWin
6.3
Sway
Sway
1.10
COSMIC
COSMIC
0.1
Hyprland
Hyprland
0.44
niri
25.02
Weston
Weston
14
Mir
Mir
2.19
GameScope
GameScope
3.15.14
Jay
1.9.0
Labwc
Labwc
0.8.2
Wayfire
Wayfire
0.9.0
Treeland
Treeland
0.5.17
Louvre
Louvre
2.14.1
zxdg_decoration_manager_v1
x
1
1
1
1
1
x
1
x
1
1
1
1
1

Copyright © 2018 Simon Ser Copyright © 2024 Emma MB

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.