pub struct LayerSurface { /* private fields */ }wayland_frontend only.Expand description
A handle to a layer surface
Implementations§
Source§impl LayerSurface
impl LayerSurface
Sourcepub fn send_pending_configure(&self) -> Option<Serial>
pub fn send_pending_configure(&self) -> Option<Serial>
Send a pending configure event to this layer surface to suggest it a new configuration
If changes have occurred a configure event will be send to the clients and the serial will be returned
(for tracking the configure in WlrLayerShellHandler::ack_configure if desired).
If no changes occurred no event will be send and None will be returned.
See send_configure and has_pending_changes
for more information.
Sourcepub fn send_configure(&self) -> Serial
pub fn send_configure(&self) -> Serial
Send a configure event to this layer surface to suggest it a new configuration
The serial of this configure will be tracked waiting for the client to ACK it.
You can manipulate the state that will be sent to the client with the with_pending_state
method.
Note: This will always send a configure event, if you intend to only send a configure event on changes take a look at
send_pending_configure
Sourcepub fn ensure_configured(&self) -> bool
pub fn ensure_configured(&self) -> bool
Make sure this surface was configured
Returns true if it was, if not, returns false and raise
a protocol error to the associated layer surface. Also returns false
if the surface is already destroyed.
Sourcepub fn send_close(&self)
pub fn send_close(&self)
Send a “close” event to the client
Sourcepub fn wl_surface(&self) -> &WlSurface
pub fn wl_surface(&self) -> &WlSurface
Access the underlying wl_surface of this layer surface
Returns None if the layer surface actually no longer exists.
Sourcepub fn with_pending_state<F, T>(&self, f: F) -> Twhere
F: FnOnce(&mut LayerSurfaceState) -> T,
pub fn with_pending_state<F, T>(&self, f: F) -> Twhere
F: FnOnce(&mut LayerSurfaceState) -> T,
Allows the pending state of this layer to be manipulated.
This should be used to inform the client about size and state changes, for example after a resize request from the client.
The state will be sent to the client when calling send_configure.
Sourcepub fn has_pending_changes(&self) -> bool
pub fn has_pending_changes(&self) -> bool
Tests this LayerSurface for pending changes
Returns true if with_pending_state was used to manipulate the state
and resulted in a different state or if the initial configure is still pending.
Sourcepub fn current_state(&self) -> LayerSurfaceState
pub fn current_state(&self) -> LayerSurfaceState
Gets a copy of the current state of this layer
Returns None if the underlying surface has been
destroyed
Sourcepub fn shell_surface(&self) -> &ZwlrLayerSurfaceV1
pub fn shell_surface(&self) -> &ZwlrLayerSurfaceV1
Access the underlying zwlr_layer_surface_v1 of this layer surface
Trait Implementations§
Source§impl Clone for LayerSurface
impl Clone for LayerSurface
Source§fn clone(&self) -> LayerSurface
fn clone(&self) -> LayerSurface
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LayerSurface
impl Debug for LayerSurface
Source§impl PartialEq for LayerSurface
impl PartialEq for LayerSurface
Auto Trait Implementations§
impl Freeze for LayerSurface
impl !RefUnwindSafe for LayerSurface
impl Send for LayerSurface
impl Sync for LayerSurface
impl Unpin for LayerSurface
impl !UnwindSafe for LayerSurface
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§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.