---
name: "wayland_server_zxdg_shell_v6_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_shell_v6_t"
---

# wayland\_server\_zxdg\_shell\_v6\_t(3)

create desktop-style surfaces

## NAME

wayland::server::zxdg\_shell\_v6\_t - create desktop-style surfaces

## SYNOPSIS

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

Inherits wayland::server::resource\_t.

### Public Member Functions

std::function\< void()\> & **on\_destroy** ()\
 destroy xdg\_shell  std::function\< void(**zxdg\_positioner\_v6\_t**)\> & **on\_create\_positioner** ()\
 create a positioner object  std::function\< void(**zxdg\_surface\_v6\_t**, **surface\_t**)\> & **on\_get\_xdg\_surface** ()\
 create a shell surface from a surface  std::function\< void(uint32\_t)\> & **on\_pong** ()\
 respond to a ping event  void **ping** (uint32\_t serial, bool post=true)\
 check if the client is alive  void **post\_role** (std::string const &msg)\
 Post error: given wl\_surface has another role.  void **post\_defunct\_surfaces** (std::string const &msg)\
 Post error: xdg\_shell was destroyed before children.  void **post\_not\_the\_topmost\_popup** (std::string const &msg)\
 Post error: the client tried to map or destroy a non-topmost popup.  void **post\_invalid\_popup\_parent** (std::string const &msg)\
 Post error: the client specified an invalid popup parent surface.  void **post\_invalid\_surface\_state** (std::string const &msg)\
 Post error: the client provided an invalid surface state.  void **post\_invalid\_positioner** (std::string const &msg)\
 Post error: the client provided an invalid positioner.  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 **ping\_since\_version** = 1\
 Minimum protocol version required for the **ping** function.

## Detailed Description

create desktop-style surfaces

xdg\_shell allows clients to turn a wl\_surface into a 'real window' which can be dragged, resized, stacked, and moved around by the user. Everything about this interface is suited towards traditional desktop environments.

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

## Member Function Documentation

### 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\_positioner\_v6\_t)\> & zxdg\_shell\_v6\_t::on\_create\_positioner ()

create a positioner object

**Parameters**

*id*

Create a positioner object. A positioner object is used to position surfaces relative to some parent surface. See the interface description and xdg\_surface.get\_popup for details.

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

### std::function\< void()\> & zxdg\_shell\_v6\_t::on\_destroy ()

destroy xdg\_shell Destroy this xdg\_shell object.

Destroying a bound xdg\_shell object while there are surfaces still alive created by this xdg\_shell object instance is illegal and will result in a protocol error.

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

### std::function\< void(zxdg\_surface\_v6\_t, surface\_t)\> & zxdg\_shell\_v6\_t::on\_get\_xdg\_surface ()

create a shell surface from a surface

**Parameters**

*id* \
 *surface*

This creates an xdg\_surface for the given surface. While xdg\_surface itself is not a role, the corresponding surface may only be assigned a role extending xdg\_surface, such as xdg\_toplevel or xdg\_popup.

This creates an xdg\_surface for the given surface. An xdg\_surface is used as basis to define a role to a given surface, such as xdg\_toplevel or xdg\_popup. It also manages functionality shared between xdg\_surface based surface roles.

See the documentation of xdg\_surface for more details about what an xdg\_surface is and how it is used.

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

### std::function\< void(uint32\_t)\> & zxdg\_shell\_v6\_t::on\_pong ()

respond to a ping event

**Parameters**

*serial* serial of the ping event

A client must respond to a ping event with a pong request or the client may be deemed unresponsive. See xdg\_shell.ping.

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

### void zxdg\_shell\_v6\_t::ping (uint32\_t serial, bool post = `true`)

check if the client is alive

**Parameters**

*serial* pass this to the pong request

The ping event asks the client if it's still alive. Pass the serial specified in the event back to the compositor by sending a 'pong' request back with the specified serial. See xdg\_shell.ping.

Compositors can use this to determine if the client is still alive. It's unspecified what will happen if the client doesn't respond to the ping request, or in what timeframe. Clients should try to respond in a reasonable amount of time.

A compositor is free to ping in any way it wants, but a client must always respond to any xdg\_shell object it created.

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

### void zxdg\_shell\_v6\_t::post\_defunct\_surfaces (std::string const & msg)

Post error: xdg\_shell was destroyed before children.

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

### void zxdg\_shell\_v6\_t::post\_invalid\_popup\_parent (std::string const & msg)

Post error: the client specified an invalid popup parent surface.

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

### void zxdg\_shell\_v6\_t::post\_invalid\_positioner (std::string const & msg)

Post error: the client provided an invalid positioner.

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

### void zxdg\_shell\_v6\_t::post\_invalid\_surface\_state (std::string const & msg)

Post error: the client provided an invalid surface state.

Definition at line **8234** 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\_shell\_v6\_t::post\_not\_the\_topmost\_popup (std::string const & msg)

Post error: the client tried to map or destroy a non-topmost popup.

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

### void zxdg\_shell\_v6\_t::post\_role (std::string const & msg)

Post error: given wl\_surface has another role.

Definition at line **8214** 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\_shell\_v6\_t::ping\_since\_version = 1` [static]`, ` [constexpr]`

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

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

## Author

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