pub struct XdgPopup { /* private fields */ }
Expand 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.
See also the Request enum for this interface.
Implementations§
source§impl XdgPopup
impl XdgPopup
sourcepub fn configure(&self, x: i32, y: i32, width: i32, height: i32)
pub fn configure(&self, x: i32, y: i32, width: i32, height: i32)
configure the popup surface
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.
sourcepub fn popup_done(&self)
pub fn popup_done(&self)
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.
sourcepub fn repositioned(&self, token: u32)
pub fn repositioned(&self, token: u32)
signal the completion of a repositioned request
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.
Trait Implementations§
source§impl Resource for XdgPopup
impl Resource for XdgPopup
source§fn object_data(&self) -> Option<&Arc<dyn Any + Send + Sync>>
fn object_data(&self) -> Option<&Arc<dyn Any + Send + Sync>>
source§fn handle(&self) -> &WeakHandle
fn handle(&self) -> &WeakHandle
source§fn from_id(conn: &DisplayHandle, id: ObjectId) -> Result<Self, InvalidId>
fn from_id(conn: &DisplayHandle, id: ObjectId) -> Result<Self, InvalidId>
source§fn send_event(&self, evt: Self::Event<'_>) -> Result<(), InvalidId>
fn send_event(&self, evt: Self::Event<'_>) -> Result<(), InvalidId>
source§fn parse_request(
conn: &DisplayHandle,
msg: Message<ObjectId, OwnedFd>,
) -> Result<(Self, Self::Request), DispatchError>
fn parse_request( conn: &DisplayHandle, msg: Message<ObjectId, OwnedFd>, ) -> Result<(Self, Self::Request), DispatchError>
source§fn write_event<'a>(
&self,
conn: &DisplayHandle,
msg: Self::Event<'a>,
) -> Result<Message<ObjectId, BorrowedFd<'a>>, InvalidId>
fn write_event<'a>( &self, conn: &DisplayHandle, msg: Self::Event<'a>, ) -> Result<Message<ObjectId, BorrowedFd<'a>>, InvalidId>
source§fn is_alive(&self) -> bool
fn is_alive(&self) -> bool
impl Eq for XdgPopup
Auto Trait Implementations§
impl Freeze for XdgPopup
impl !RefUnwindSafe for XdgPopup
impl Send for XdgPopup
impl Sync for XdgPopup
impl Unpin for XdgPopup
impl !UnwindSafe for XdgPopup
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.