.TH "wayland::server::xdg_popup_t" 3 "Wed May 3 2023" "Version 1.0.0" "Wayland++" \" -*- nroff -*- .ad l .nh .SH NAME wayland::server::xdg_popup_t \- short-lived, popup surfaces for menus .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits wayland::server::resource_t\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "std::function< void()> & \fBon_destroy\fP ()" .br .RI "remove xdg_popup interface " .ti -1c .RI "std::function< void(\fBseat_t\fP, uint32_t)> & \fBon_grab\fP ()" .br .RI "make the popup take an explicit grab " .ti -1c .RI "std::function< void(\fBxdg_positioner_t\fP, uint32_t)> & \fBon_reposition\fP ()" .br .RI "recalculate the popup's location " .ti -1c .RI "void \fBconfigure\fP (int32_t x, int32_t y, int32_t width, int32_t height, bool post=true)" .br .RI "configure the popup surface " .ti -1c .RI "void \fBpopup_done\fP (bool post=true)" .br .RI "popup interaction is done " .ti -1c .RI "void \fBrepositioned\fP (uint32_t token, bool post=true)" .br .RI "signal the completion of a repositioned request " .ti -1c .RI "bool \fBcan_repositioned\fP () const" .br .RI "Check whether the \fBrepositioned\fP function is available with the currently bound version of the protocol\&. " .ti -1c .RI "void \fBpost_invalid_grab\fP (std::string const &msg)" .br .RI "Post error: tried to grab after being mapped\&. " .ti -1c .RI "bool \fBproxy_has_object\fP () const" .br .RI "Check whether this wrapper actually wraps an object\&. " .ti -1c .RI "void \fBpost_no_memory\fP () const" .br .ti -1c .RI "uint32_t \fBget_id\fP () const" .br .ti -1c .RI "client_t \fBget_client\fP () const" .br .ti -1c .RI "unsigned int \fBget_version\fP () const" .br .ti -1c .RI "std::string \fBget_class\fP ()" .br .in -1c .SS "Static Public Attributes" .in +1c .ti -1c .RI "static constexpr std::uint32_t \fBconfigure_since_version\fP = 1" .br .RI "Minimum protocol version required for the \fBconfigure\fP function\&. " .ti -1c .RI "static constexpr std::uint32_t \fBpopup_done_since_version\fP = 1" .br .RI "Minimum protocol version required for the \fBpopup_done\fP function\&. " .ti -1c .RI "static constexpr std::uint32_t \fBrepositioned_since_version\fP = 3" .br .RI "Minimum protocol version required for the \fBrepositioned\fP function\&. " .in -1c .SH "Detailed Description" .PP 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\&. .PP A popup can be made to take an explicit grab\&. See xdg_popup\&.grab for details\&. .PP 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\&. .PP 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\&. .PP A newly created xdg_popup will be stacked on top of all previously created xdg_popup surfaces associated with the same xdg_toplevel\&. .PP The parent of an xdg_popup must be mapped (see the xdg_surface description) before the xdg_popup itself\&. .PP The client must call wl_surface\&.commit on the corresponding wl_surface for the xdg_popup state to take effect\&. .PP Definition at line \fB1880\fP of file \fBwayland\-server\-protocol\-extra\&.hpp\fP\&. .SH "Member Function Documentation" .PP .SS "bool xdg_popup_t::can_repositioned () const" .PP Check whether the \fBrepositioned\fP function is available with the currently bound version of the protocol\&. .PP Definition at line \fB1476\fP of file \fBwayland\-server\-protocol\-extra\&.cpp\fP\&. .SS "void xdg_popup_t::configure (int32_t x, int32_t y, int32_t width, int32_t height, bool post = \fCtrue\fP)" .PP configure the popup surface .PP \fBParameters\fP .RS 4 \fIx\fP x position relative to parent surface window geometry .br \fIy\fP y position relative to parent surface window geometry .br \fIwidth\fP window geometry width .br \fIheight\fP window geometry height .RE .PP 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\&. .PP 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\&. .PP 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\&. .PP Definition at line \fB1461\fP of file \fBwayland\-server\-protocol\-extra\&.cpp\fP\&. .SS "std::string wayland::server::resource_t::get_class ()\fC [inherited]\fP" Retrieve the interface name (class) of a resource object\&. .PP \fBReturns\fP .RS 4 Interface name of the resource object\&. .RE .PP .SS "client_t wayland::server::resource_t::get_client () const\fC [inherited]\fP" Get the associated client .PP \fBReturns\fP .RS 4 the client that owns the resource\&. .RE .PP .SS "uint32_t wayland::server::resource_t::get_id () const\fC [inherited]\fP" Get the internal ID of the resource .PP \fBReturns\fP .RS 4 the internal ID of the resource .RE .PP .SS "unsigned int wayland::server::resource_t::get_version () const\fC [inherited]\fP" Get interface version .PP \fBReturns\fP .RS 4 Interface version this resource has been constructed with\&. .RE .PP .SS "std::function< void()> & xdg_popup_t::on_destroy ()" .PP remove xdg_popup interface This destroys the popup\&. Explicitly destroying the xdg_popup object will also dismiss the popup, and unmap the surface\&. .PP If this xdg_popup is not the 'topmost' popup, a protocol error will be sent\&. .PP Definition at line \fB1443\fP of file \fBwayland\-server\-protocol\-extra\&.cpp\fP\&. .SS "std::function< void(\fBseat_t\fP, uint32_t)> & xdg_popup_t::on_grab ()" .PP make the popup take an explicit grab .PP \fBParameters\fP .RS 4 \fIseat\fP the wl_seat of the user event .br \fIserial\fP the serial of the user event .RE .PP 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\&. .PP If the compositor denies the grab, the popup will be immediately dismissed\&. .PP 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'\&. .PP 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\&. .PP 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\&. .PP 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\&. .PP 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\&. .PP 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\&. .PP 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\&. .PP 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\&. .PP Definition at line \fB1449\fP of file \fBwayland\-server\-protocol\-extra\&.cpp\fP\&. .SS "std::function< void(\fBxdg_positioner_t\fP, uint32_t)> & xdg_popup_t::on_reposition ()" .PP recalculate the popup's location .PP \fBParameters\fP .RS 4 \fIpositioner\fP .br \fItoken\fP reposition request token .RE .PP 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\&. .PP 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\&. .PP If multiple reposition requests are sent, the compositor may skip all but the last one\&. .PP 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\&. .PP 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\&. .PP Definition at line \fB1455\fP of file \fBwayland\-server\-protocol\-extra\&.cpp\fP\&. .SS "void xdg_popup_t::popup_done (bool post = \fCtrue\fP)" .PP 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\&. .PP Definition at line \fB1466\fP of file \fBwayland\-server\-protocol\-extra\&.cpp\fP\&. .SS "void xdg_popup_t::post_invalid_grab (std::string const & msg)" .PP Post error: tried to grab after being mapped\&. .PP Definition at line \fB1481\fP of file \fBwayland\-server\-protocol\-extra\&.cpp\fP\&. .SS "void wayland::server::resource_t::post_no_memory () const\fC [inherited]\fP" Post 'not enough memory' error to the client .PP 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\&. .SS "bool wayland::server::resource_t::proxy_has_object () const\fC [inherited]\fP" .PP Check whether this wrapper actually wraps an object\&. .PP \fBReturns\fP .RS 4 true if there is an underlying object, false if this wrapper is empty .RE .PP .SS "void xdg_popup_t::repositioned (uint32_t token, bool post = \fCtrue\fP)" .PP signal the completion of a repositioned request .PP \fBParameters\fP .RS 4 \fItoken\fP reposition request token .RE .PP 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\&. .PP 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\&. .PP 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\&. .PP 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\&. .PP Definition at line \fB1471\fP of file \fBwayland\-server\-protocol\-extra\&.cpp\fP\&. .SH "Member Data Documentation" .PP .SS "constexpr std::uint32_t wayland::server::xdg_popup_t::configure_since_version = 1\fC [static]\fP, \fC [constexpr]\fP" .PP Minimum protocol version required for the \fBconfigure\fP function\&. .PP Definition at line \fB2023\fP of file \fBwayland\-server\-protocol\-extra\&.hpp\fP\&. .SS "constexpr std::uint32_t wayland::server::xdg_popup_t::popup_done_since_version = 1\fC [static]\fP, \fC [constexpr]\fP" .PP Minimum protocol version required for the \fBpopup_done\fP function\&. .PP Definition at line \fB2036\fP of file \fBwayland\-server\-protocol\-extra\&.hpp\fP\&. .SS "constexpr std::uint32_t wayland::server::xdg_popup_t::repositioned_since_version = 3\fC [static]\fP, \fC [constexpr]\fP" .PP Minimum protocol version required for the \fBrepositioned\fP function\&. .PP Definition at line \fB2062\fP of file \fBwayland\-server\-protocol\-extra\&.hpp\fP\&. .SH "Author" .PP Generated automatically by Doxygen for Wayland++ from the source code\&.