wayland::server::xdg_popup_t(3)

okay bestie, welcome to the wayland::server::xdg_popup_t(3) page from Wayland++ πŸ’– this is the manual for the short-lived popup surface wrapper, and yes she is giving temporary-main-character energy ✨

🌸 NAME 🌸

wayland::server::xdg_popup_t β€” short-lived, popup surfaces for menus πŸ“

✨ SYNOPSIS ✨

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

πŸ’… Public Member Functions πŸ’…

  • std::function< void()> & on_destroy () β€” remove xdg_popup interface
  • std::function< void(seat_t, uint32_t)> & on_grab () β€” make the popup take an explicit grab
  • std::function< void(xdg_positioner_t, uint32_t)> & on_reposition () β€” recalculate the popup's location
  • void configure (int32_t x, int32_t y, int32_t width, int32_t height, bool post=true) β€” configure the popup surface
  • void popup_done (bool post=true) β€” popup interaction is done
  • void repositioned (uint32_t token, bool post=true) β€” signal the completion of a repositioned request
  • bool can_repositioned () const β€” check whether the repositioned function is available with the currently bound version of the protocol
  • void post_invalid_grab (std::string const &msg) β€” Post error: tried to grab after being mapped.
  • bool proxy_has_object () const β€” check whether this wrapper actually wraps an object
  • void post_no_memory () const β€” post "not enough memory" error to the client
  • uint32_t get_id () const β€” get the internal ID of the resource
  • client_t get_client () const β€” get the associated client
  • unsigned int get_version () const β€” get interface version
  • std::string get_class () β€” retrieve the interface name (class) of a resource object

πŸŽ€ Static Public Attributes πŸŽ€

  • static constexpr std::uint32_t configure_since_version = 1 β€” Minimum protocol version required for the configure function.
  • static constexpr std::uint32_t popup_done_since_version = 1 β€” Minimum protocol version required for the popup_done function.
  • static constexpr std::uint32_t repositioned_since_version = 3 β€” Minimum protocol version required for the repositioned function.

πŸ’– Detailed Description πŸ’–

short-lived, popup surfaces for menus

okay so picture a popup surface: it’s a short-lived, temporary surface. You can use it for menus, popovers, tooltips, and other similar user interface concepts, no cap πŸ’…

A popup can be made to take an explicit grab. See xdg_popup.grab for the deets.

When the popup is dismissed, a popup_done event will be sent out, and at the same time the surface will be unmapped. See the xdg_popup.popup_done event for details.

Explicitly destroying the xdg_popup object will also dismiss the popup and unmap the surface. Clients that want to dismiss the popup when another surface of their own is clicked should dismiss the popup using the destroy request 🫢

A newly created xdg_popup will be stacked on top of all previously created xdg_popup surfaces associated with the same xdg_toplevel. Iconic stacking behavior, honestly.

The parent of an xdg_popup must be mapped (see the xdg_surface description) before the xdg_popup itself. Important timing vibe check ⏰

The client must call wl_surface.commit on the corresponding wl_surface for the xdg_popup state to take effect. Don’t skip the commit, bestie ✨

Definition at line 1881 of file wayland-server-protocol-extra.hpp.


πŸŽ€ Member Function Documentation πŸŽ€

bool xdg_popup_t::can_repositioned () const

Check whether the repositioned function is available with the currently bound version of the protocol. Basically a little availability vibe check for that function πŸ’…

Definition at line 1476 of file wayland-server-protocol-extra.cpp.

void xdg_popup_t::configure (int32_t x, int32_t y, int32_t width, int32_t height, bool post = true)

configure the popup surface

Parameters:

  • x β€” x position relative to parent surface window geometry
  • y β€” y position relative to parent surface window geometry
  • width β€” window geometry width
  • height β€” window geometry height

This event asks the popup surface to configure itself given the configuration. The configured state should not be applied immediately. See xdg_surface.configure for details.

The x and y arguments represent the position the popup was placed at given the xdg_positioner rule, relative to the upper left corner of the window geometry of the parent surface.

For version 2 or older, the configure event for an xdg_popup is only ever sent once for the initial configuration. Starting with version 3, it may be sent again if the popup is setup with an xdg_positioner with set_reactive requested, or in response to xdg_popup.reposition requests.

Definition at line 1461 of file wayland-server-protocol-extra.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()> & xdg_popup_t::on_destroy ()

remove xdg_popup interface. This destroys the popup. Explicitly destroying the xdg_popup object will also dismiss the popup, and unmap the surface.

If this xdg_popup is not the "topmost" popup, a protocol error will be sent ⚠️

Definition at line 1443 of file wayland-server-protocol-extra.cpp.

std::function< void(seat_t, uint32_t)> & xdg_popup_t::on_grab ()

make the popup take an explicit grab

Parameters:

  • seat β€” the wl_seat of the user event
  • serial β€” the serial of the user event

This request makes the created popup take an explicit grab. An explicit grab will be dismissed when the user dismisses the popup, or when the client destroys the xdg_popup. This can be done by the user clicking outside the surface, using the keyboard, or even locking the screen through closing the lid or a timeout 😭

If the compositor denies the grab, the popup will be immediately dismissed.

This request must be used in response to some sort of user action like a button press, key press, or touch down event. The serial number of the event should be passed as 'serial'.

The parent of a grabbing popup must either be an xdg_toplevel surface or another xdg_popup with an explicit grab. If the parent is another xdg_popup it means that the popups are nested, with this popup now being the topmost popup.

Nested popups must be destroyed in the reverse order they were created in, e.g. the only popup you are allowed to destroy at all times is the topmost one. No skipping the stack, bestie 🫢

When compositors choose to dismiss a popup, they may dismiss every nested grabbing popup as well. When a compositor dismisses popups, it will follow the same dismissing order as required from the client.

The parent of a grabbing popup must either be another xdg_popup with an active explicit grab, or an xdg_popup or xdg_toplevel, if there are no explicit grabs already taken.

If the topmost grabbing popup is destroyed, the grab will be returned to the parent of the popup, if that parent previously had an explicit grab.

If the parent is a grabbing popup which has already been dismissed, this popup will be immediately dismissed. If the parent is a popup that did not take an explicit grab, an error will be raised πŸ’€

During a popup grab, the client owning the grab will receive pointer and touch events for all their surfaces as normal (similar to an "owner-events" grab in X11 parlance), while the top most grabbing popup will always have keyboard focus.

Definition at line 1449 of file wayland-server-protocol-extra.cpp.

std::function< void(xdg_positioner_t, uint32_t)> & xdg_popup_t::on_reposition ()

recalculate the popup's location

Parameters:

  • positioner
  • token β€” reposition request token

Reposition an already-mapped popup. The popup will be placed given the details in the passed xdg_positioner object, and a xdg_popup.repositioned followed by xdg_popup.configure and xdg_surface.configure will be emitted in response. Any parameters set by the previous positioner will be discarded.

The passed token will be sent in the corresponding xdg_popup.repositioned event. The new popup position will not take effect until the corresponding configure event is acknowledged by the client. See xdg_popup.repositioned for details. The token itself is opaque, and has no other special meaning ✨

If multiple reposition requests are sent, the compositor may skip all but the last one.

If the popup is repositioned in response to a configure event for its parent, the client should send an xdg_positioner.set_parent_configure and possibly an xdg_positioner.set_parent_size request to allow the compositor to properly constrain the popup.

If the popup is repositioned together with a parent that is being resized, but not in response to a configure event, the client should send an xdg_positioner.set_parent_size request.

Definition at line 1455 of file wayland-server-protocol-extra.cpp.

void xdg_popup_t::popup_done (bool post = true)

popup interaction is done. The popup_done event is sent out when a popup is dismissed by the compositor. The client should destroy the xdg_popup object at this point.

Definition at line 1466 of file wayland-server-protocol-extra.cpp.

void xdg_popup_t::post_invalid_grab (std::string const &msg)

Post error: tried to grab after being mapped. 🚨

Definition at line 1481 of file wayland-server-protocol-extra.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.

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

void xdg_popup_t::repositioned (uint32_t token, bool post = true)

signal the completion of a repositioned request

Parameters:

  • token β€” reposition request token

The repositioned event is sent as part of a popup configuration sequence, together with xdg_popup.configure and lastly xdg_surface.configure to notify the completion of a reposition request.

The repositioned event is to notify about the completion of a xdg_popup.reposition request. The token argument is the token passed in the xdg_popup.reposition request.

Immediately after this event is emitted, xdg_popup.configure and xdg_surface.configure will be sent with the updated size and position, as well as a new configure serial.

The client should optionally update the content of the popup, but must acknowledge the new popup configuration for the new position to take effect. See xdg_surface.ack_configure for details.

Definition at line 1471 of file wayland-server-protocol-extra.cpp.

πŸŽ€ MEMBER DATA DOCUMENTATION πŸŽ€

Okay bestie, these are the static constants β€” the little version-check bouncers at the door of each function πŸ’… They're all [static] and [constexpr], which is giving "compile-time royalty, cannot be touched, do not try her." πŸ‘‘

  • std::uint32_t wayland::server::xdg_popup_t::configure_since_version = 1 β€” [static], [constexpr]. This is the minimum protocol version this whole configure function needs before it'll show up to the party. It's 1, so basically ancient-protocol friendly. Iconic low bar, honestly. ✨

Defined at line 2024 of wayland-server-protocol-extra.hpp.

  • std::uint32_t wayland::server::xdg_popup_t::popup_done_since_version = 1 β€” [static], [constexpr]. The minimum protocol version required for the popup_done function. Also 1 β€” she's been here since day one, no gatekeeping, we love that for her 🫢

Defined at line 2037 of wayland-server-protocol-extra.hpp.

  • std::uint32_t wayland::server::xdg_popup_t::repositioned_since_version = 3 β€” [static], [constexpr]. Minimum protocol version required for the repositioned function, and this one's a 3 β€” so she's the newer girl on the block πŸ’… If your protocol version is lower than 3, repositioned is literally not available. Vibe check: failed. πŸ’€

Defined at line 2063 of wayland-server-protocol-extra.hpp.


🌸 Quick little recap so it sticks: configure ➑️ version 1, popup_done ➑️ version 1, repositioned ➑️ version 3. Three constants, three line numbers, zero skipping. Periodt. πŸ‘‘

✨ AUTHOR ✨

Generated automatically by Doxygen for Wayland++ from the source code. Not me writing it by hand, not you, not anyone's bestie β€” the robots did it 🧚✨


And that's a wrap on the whole page, bestie!! πŸŽ€πŸŒˆ This one's version 1.0.1, dated Fri Mar 27 2026, and it comes to you courtesy of the wayland::server::xdg_popup_t(3) manual page. Go forth and popup responsibly πŸ’–πŸ¦‹

πŸ“¦ where this page comes from