wayland::serve...ecoration_v1_t(3)

🌸 NAME 🌸

okay so bestie, welcome to Wayland++ (that's the manual this page lives in πŸ’–) β€” this one's all about wayland::server::zxdg_toplevel_decoration_v1_t, aka the decoration object for a toplevel surface. she's giving window-chrome middle management and honestly? iconic. πŸŽ€


✨ SYNOPSIS ✨

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

πŸ’… 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 β€” yeah, that's the whole vibe of this class, no notes ✨

So here's the tea: the decoration object lets the compositor toggle server-side window decorations for a toplevel surface. The client can request to switch to another mode. teamwork, but make it protocol πŸ’…

🚨 important one, don't skip it: the xdg_toplevel_decoration object must be destroyed before its xdg_toplevel. order matters, bestie. do not come for me if you get this backwards 😭

Definition at line 7812 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

okay so the configure event is basically sliding into the client's DMs asking it to change its decoration mode. but β€” and this is the important part β€” the configured state should not be applied immediately. nope, not yet, hold the thought πŸ™ˆ

Clients must send an ack_configure in response to this event. like, mandatory. See xdg_surface.configure and xdg_surface.ack_configure for details (iykyk, the whole handshake situation).

A configure event can be sent at any time, and the specified mode must be obeyed by the client. no negotiating, no "seen 2 hours ago" energy. periodt. πŸ‘‘

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. cute and functional 🫢

πŸ’« client_t wayland::server::resource_t::get_client () const [inherited]

Get the associated client.

Returns

the client that owns the resource. main character client energy 🌈

πŸ’« uint32_t wayland::server::resource_t::get_id () const [inherited]

Get the internal ID of the resource.

Returns

the internal ID of the resource β€” every girl needs her own identifier πŸ’…

πŸ’« 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 β€” and switch back to a mode without any server-side decorations at the next commit. like packing up your whole setup at the end of the video πŸŽ€

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. (prefers! not demands! subtle but real difference bestie πŸ¦‹)

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). full loop, no shortcuts πŸ’€

Buuut the compositor can decide not to use the client's mode and enforce a different mode instead. yeah. the compositor has veto power, that's just the situation πŸ™ˆ

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. do not spam, do not cause a loop, we are better than that 😭πŸ”₯

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. unbothered. free. unspecified. ✨

This request has the same semantics as set_mode. so like, read the whole bit above, it applies fr fr πŸ’œ

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. you doubled up, babe πŸ’€

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 certain request of the client, this function can be called to notify the client of this circumstance. lowkey the saddest error to send 😭🫢

🌟 void zxdg_toplevel_decoration_v1_t::post_orphaned (std::string const & msg)

Post error: xdg_toplevel destroyed before the decoration object. we talked about this. destruction order bestie 🚨

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. wait your turn please, the configure hasn't even happened yet πŸ™ˆ

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. vibe check for wrappers, literally πŸ’…


πŸ¦‹ Member Data Documentation πŸ¦‹

⭐ std::uint32_t wayland::server::zxdg_toplevel_decoration_v1_t::configure_since_version = 1 [static], [constexpr]

Minimum protocol version required for the configure function. she's been here since day one, a founding member of the group chat πŸ‘‘βœ¨

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


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for Wayland++ from the source code. not a human writing this one, just the machine doing its thing πŸ€–πŸ’–


and that's the whole page bestie!! πŸ¦‹βœ¨ ily, go destroy your decoration object before your xdg_toplevel, and remember β€” this was Wayland++ Version 1.0.1, dated Fri Mar 27 2026, straight from the source code, no cap πŸ’œπŸŽ€πŸ«Ά

πŸ“¦ where this page comes from