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 objectstd::function< void(zxdg_toplevel_decoration_v1_mode)> & on_set_mode ()β set the decoration modestd::function< void()> & on_unset_mode ()β unset the decoration modevoid configure (zxdg_toplevel_decoration_v1_mode const &mode, bool post=true)β suggest a surface changevoid 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 () constuint32_t get_id () constclient_t get_client () constunsigned int get_version () conststd::string get_class ()
π¦ Static Public Attributes
static constexpr std::uint32_t configure_since_version = 1β Minimum protocol version required for theconfigurefunction.
π 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: thexdg_toplevel_decorationobject must be destroyed before itsxdg_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
- ubuntu stonking: waylandpp-dev 1.0.1-2 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms