wayland::xdg_popup_t(3)

๐ŸŒธ NAME ๐ŸŒธ

Welcome to wayland::xdg_popup_t(3) from Wayland++ โ€” bestie, this one is literally all about short-lived, popup surfaces for menus ๐Ÿ’–


โœจ SYNOPSIS โœจ

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

Inherits wayland::proxy_t ๐Ÿซถ

๐ŸŽ€ Public Types ๐ŸŽ€

  • enum class wrapper_type { standard, display, foreign, proxy_wrapper }

๐Ÿซถ Public Member Functions ๐Ÿซถ

  • void grab (seat_t const &seat, uint32_t serial) โ€” make the popup take an explicit grab ๐Ÿ‘‘
  • void reposition (xdg_positioner_t const &positioner, uint32_t token) โ€” recalculate the popup's location ๐Ÿงš
  • bool can_reposition () const โ€” Check whether the reposition function is available with the currently bound version of the protocol.
  • std::function< void(int32_t, int32_t, int32_t, int32_t)> & on_configure () โ€” configure the popup surface โœจ
  • std::function< void()> & on_popup_done () โ€” popup interaction is done ๐Ÿ’…
  • std::function< void(uint32_t)> & on_repositioned () โ€” signal the completion of a repositioned request โญ
  • uint32_t get_id () const โ€” Get the id of a proxy object.
  • std::string get_class () const โ€” Get the interface name (class) of a proxy object.
  • uint32_t get_version () const โ€” Get the protocol object version of a proxy object.
  • wrapper_type get_wrapper_type () const โ€” Get the type of a proxy object.
  • void set_queue (event_queue_t queue) โ€” Assign a proxy to an event queue.
  • wl_proxy * c_ptr () const โ€” Get a pointer to the underlying C struct.
  • bool proxy_has_object () const โ€” Check whether this wrapper actually wraps an object.
  • operator bool () const โ€” Check whether this wrapper actually wraps an object.
  • bool operator== (const proxy_t &right) const โ€” Check whether two wrappers refer to the same object.
  • bool operator!= (const proxy_t &right) const โ€” Check whether two wrappers refer to different objects.
  • void proxy_release () โ€” Release the wrapped object (if any), making this an empty wrapper.

๐Ÿ’Ž Static Public Attributes ๐Ÿ’Ž

  • static constexpr std::uint32_t grab_since_version = 1 โ€” Minimum protocol version required for the grab function.
  • static constexpr std::uint32_t reposition_since_version = 3 โ€” Minimum protocol version required for the reposition function.

๐Ÿฆ‹ Detailed Description ๐Ÿฆ‹

short-lived, popup surfaces for menus

A popup surface is a short-lived, temporary surface. It can be used to implement for example menus, popovers, tooltips and other similar user interface concepts. ๐Ÿ’–

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

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.

The parent of an xdg_popup must be mapped (see the xdg_surface description) before the xdg_popup itself.

The client must call wl_surface.commit on the corresponding wl_surface for the xdg_popup state to take effect.

Definition at line 1777 of file wayland-client-protocol-extra.hpp.


๐Ÿ”ฎ Member Enumeration Documentation ๐Ÿ”ฎ

๐Ÿงฌ enum class wayland::proxy_t::wrapper_type [strong], [inherited]

Underlying wl_proxy type and properties of a proxy_t that affect construction, destruction, and event handling ๐Ÿซถ

Enumerator

  • standard โ€” C pointer is a standard type compatible with wl_proxy*. Events are dispatched and it is destructed when the proxy_t is destructed. User data is set.
  • display โ€” C pointer is a wl_display*. No events are dispatched, wl_display_disconnect is called when the proxy_t is destructed. User data is set.
  • foreign โ€” C pointer is a standard type compatible with wl_proxy*, but another library owns it and it should not be touched in a way that could affect the operation of the other library. No events are dispatched, wl_proxy_destroy is not called when the proxy_t is destructed, user data is not touched. Consequently, there is no reference counting for the proxy_t. Lifetime of such wrappers should preferably be short to minimize the chance that the owning library decides to destroy the wl_proxy.
  • proxy_wrapper โ€” C pointer is a wl_proxy* that was constructed with wl_proxy_create_wrapper. No events are dispatched, wl_proxy_wrapper_destroy is called when the proxy_t is destroyed. Reference counting is active. A reference to the proxy_t creating this proxy wrapper is held to extend its lifetime until after the proxy wrapper is destroyed.

Definition at line 117 of file wayland-client.hpp.

๐Ÿ’– Member Function Documentation ๐Ÿ’–

okay bestie, this is the function-by-function part, and we are not skipping a single inherited thing, parameter, or Definition at line receipt. every detail is coming with us. ๐Ÿ’…


wl_proxy * wayland::proxy_t::c_ptr () const [inherited]

Get a pointer to the underlying C struct. that's the whole vibe.

  • Returns: the underlying wl_proxy wrapped by this proxy_t if it exists, otherwise an exception is thrown.

bool xdg_popup_t::can_reposition () const

Check whether the reposition function is available with the currently bound version of the protocol. lowkey a version vibe check. โœจ

Definition at line 1521 of file wayland-client-protocol-extra.cpp.


std::string wayland::proxy_t::get_class () const [inherited]

Get the interface name (class) of a proxy object.

  • Returns: the interface name of the object associated with the proxy.

uint32_t wayland::proxy_t::get_id () const [inherited]

Get the id of a proxy object.

  • Returns: the id of the object associated with the proxy.

uint32_t wayland::proxy_t::get_version () const [inherited]

Gets the protocol object version of a proxy object, or 0 if the proxy was created with unversioned API.

A returned value of 0 means that no version information is available, so the caller must make safe assumptions about the object's real version.

display_t will always return version 0.

  • Returns: the protocol object version of the proxy or 0.

wrapper_type wayland::proxy_t::get_wrapper_type () const [inline], [inherited]

Get the type of a proxy object.

Definition at line 303 of file wayland-client.hpp.


void xdg_popup_t::grab (seat_t const & seat, uint32_t serial)

make the popup take an explicit grab. okay so this one is very main character energy. ๐Ÿ‘‘

  • 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.

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 1510 of file wayland-client-protocol-extra.cpp.


std::function< void(int32_t, int32_t, int32_t, int32_t)> & xdg_popup_t::on_configure ()

configure the popup surface. it's giving "tell me my new position and size" energy. ๐ŸŽ€

  • 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 1527 of file wayland-client-protocol-extra.cpp.


std::function< void()> & xdg_popup_t::on_popup_done ()

popup interaction is done. periodt. the popup is wrapping up its little moment. ๐Ÿ’€

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 1532 of file wayland-client-protocol-extra.cpp.


std::function< void(uint32_t)> & xdg_popup_t::on_repositioned ()

signal the completion of a repositioned request. this is the "we moved, bestie" notification. ๐Ÿฆ‹

  • 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 1537 of file wayland-client-protocol-extra.cpp.


wayland::proxy_t::operator bool () const [inherited]

Check whether this wrapper actually wraps an object.

  • Returns: true if there is an underlying object, false if this wrapper is empty.

bool wayland::proxy_t::operator!= (const proxy_t & right) const [inherited]

Check whether two wrappers refer to different objects.


bool wayland::proxy_t::operator== (const proxy_t & right) const [inherited]

Check whether two wrappers refer to the same object.


bool wayland::proxy_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 wayland::proxy_t::proxy_release () [inherited]

Release the wrapped object (if any), making this an empty wrapper. Note that display_t instances cannot be released this way. Attempts to do so are ignored.

Examples: foreign_display.cpp.


void xdg_popup_t::reposition (xdg_positioner_t const & positioner, uint32_t token)

recalculate the popup's location. slay, we're moving. ๐Ÿงš

  • positioner โ€” the 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 1516 of file wayland-client-protocol-extra.cpp.


void wayland::proxy_t::set_queue (event_queue_t queue) [inherited]

Assign a proxy to an event queue. very "you belong to this queue now" of it. ๐Ÿ’Œ

  • queue โ€” the event queue that will handle this proxy

Assign proxy to event queue. Events coming from proxy will be queued in queue instead of the display's main queue.

See also: display_t::dispatch_queue().

Examples: proxy_wrapper.cpp.


๐Ÿ“ Member Data Documentation ๐Ÿ“

std::uint32_t wayland::xdg_popup_t::grab_since_version = 1 [static], [constexpr]

Minimum protocol version required for the grab function.

Definition at line 1853 of file wayland-client-protocol-extra.hpp.


std::uint32_t wayland::xdg_popup_t::reposition_since_version = 3 [static], [constexpr]

Minimum protocol version required for the reposition function.

Definition at line 1888 of file wayland-client-protocol-extra.hpp.


๐ŸŒˆ Author ๐ŸŒˆ

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


okay that's the whole page, bestie โ€” the source is Wayland++, the version is 1.0.1, the date is Fri Mar 27 2026 13:15:00, and the footer vibe is wayland::xdg_popup_t(3). mwah ๐Ÿ’‹โœจ

๐Ÿ“ฆ where this page comes from