---
name: "wayland_server_zxdg_toplevel_decoration_v1_t"
section: "3"
platform: "linux"
package: "waylandpp-dev"
version: "1.0.0-6+b2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/wayland_server_zxdg_toplevel_decoration_v1_t"
---

# wayland\_server\_zxdg\_toplevel\_decoration\_v1\_t(3)

decoration object for a toplevel surface

## NAME

wayland::server::zxdg\_toplevel\_decoration\_v1\_t - decoration object for a toplevel surface

## SYNOPSIS

`#include <wayland-server-protocol-unstable.hpp>`

Inherits wayland::server::resource\_t.

### Public Member Functions

std::function\< void()\> & **on\_destroy** ()\
 destroy the decoration object  std::function\< void(zxdg\_toplevel\_decoration\_v1\_mode)\> & **on\_set\_mode** ()\
 set the decoration mode  std::function\< void()\> & **on\_unset\_mode** ()\
 unset the decoration mode  void **configure** (zxdg\_toplevel\_decoration\_v1\_mode const &mode, bool post=true)\
 suggest a surface change  void **post\_unconfigured\_buffer** (std::string const &msg)\
 Post error: xdg\_toplevel has a buffer attached before configure.  void **post\_already\_constructed** (std::string const &msg)\
 Post error: xdg\_toplevel already has a decoration object.  void **post\_orphaned** (std::string const &msg)\
 Post error: xdg\_toplevel destroyed before the decoration object.  bool **proxy\_has\_object** () const\
 Check whether this wrapper actually wraps an object.  void **post\_no\_memory** () const\
 uint32\_t **get\_id** () const\
 client\_t **get\_client** () const\
 unsigned int **get\_version** () const\
 std::string **get\_class** ()\

### Static Public Attributes

static constexpr std::uint32\_t **configure\_since\_version** = 1\
 Minimum protocol version required for the **configure** function.

## Detailed Description

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.

Definition at line **7811** of file **wayland-server-protocol-unstable.hpp**.

## Member Function Documentation

### void zxdg\_toplevel\_decoration\_v1\_t::configure (zxdg\_toplevel\_decoration\_v1\_mode const & mode, bool post = `true`)

suggest a surface change

**Parameters**

*mode* the decoration mode

The configure event asks the client to change its 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.

Definition at line **7626** of file **wayland-server-protocol-unstable.cpp**.

### std::string wayland::server::resource\_t::get\_class ()` [inherited]`

Retrieve the interface name (class) of a resource object.

**Returns**

Interface name of the resource object.

### client\_t wayland::server::resource\_t::get\_client () const` [inherited]`

Get the associated client

**Returns**

the client that owns the resource.

### uint32\_t wayland::server::resource\_t::get\_id () const` [inherited]`

Get the internal ID of the resource

**Returns**

the internal ID of the resource

### unsigned int wayland::server::resource\_t::get\_version () const` [inherited]`

Get interface version

**Returns**

Interface version this resource has been constructed with.

### std::function\< void()\> & zxdg\_toplevel\_decoration\_v1\_t::on\_destroy ()

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

Definition at line **7608** of file **wayland-server-protocol-unstable.cpp**.

### std::function\< void(zxdg\_toplevel\_decoration\_v1\_mode)\> & zxdg\_toplevel\_decoration\_v1\_t::on\_set\_mode ()

set the decoration mode

**Parameters**

*mode* 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 can decide not to use the client's mode and enforce a different mode instead.

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.

Definition at line **7614** of file **wayland-server-protocol-unstable.cpp**.

### std::function\< void()\> & zxdg\_toplevel\_decoration\_v1\_t::on\_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.

Definition at line **7620** of file **wayland-server-protocol-unstable.cpp**.

### void zxdg\_toplevel\_decoration\_v1\_t::post\_already\_constructed (std::string const & msg)

Post error: xdg\_toplevel already has a decoration object.

Definition at line **7636** of file **wayland-server-protocol-unstable.cpp**.

### void wayland::server::resource\_t::post\_no\_memory () const` [inherited]`

Post 'not enough memory' error to the client

If the compositor has not enough memory to fulfill a certail request of the client, this function can be called to notify the client of this circumstance.

### void zxdg\_toplevel\_decoration\_v1\_t::post\_orphaned (std::string const & msg)

Post error: xdg\_toplevel destroyed before the decoration object.

Definition at line **7641** of file **wayland-server-protocol-unstable.cpp**.

### void zxdg\_toplevel\_decoration\_v1\_t::post\_unconfigured\_buffer (std::string const & msg)

Post error: xdg\_toplevel has a buffer attached before configure.

Definition at line **7631** of file **wayland-server-protocol-unstable.cpp**.

### bool wayland::server::resource\_t::proxy\_has\_object () const` [inherited]`

Check whether this wrapper actually wraps an object.

**Returns**

true if there is an underlying object, false if this wrapper is empty

## Member Data Documentation

### constexpr std::uint32\_t wayland::server::zxdg\_toplevel\_decoration\_v1\_t::configure\_since\_version = 1` [static]`, ` [constexpr]`

Minimum protocol version required for the **configure** function.

Definition at line **7898** of file **wayland-server-protocol-unstable.hpp**.

## Author

Generated automatically by Doxygen for Wayland++ from the source code.
