pub struct ZwlrLayerSurfaceV1 { /* private fields */ }
client
only.Expand description
layer metadata interface
An interface that may be implemented by a wl_surface, for surfaces that are designed to be rendered as a layer of a stacked desktop-like environment.
Layer surface state (layer, size, anchor, exclusive zone, margin, interactivity) is double-buffered, and will be applied at the time wl_surface.commit of the corresponding wl_surface is called.
Attaching a null buffer to a layer surface unmaps it.
Unmapping a layer_surface means that the surface cannot be shown by the compositor until it is explicitly mapped again. The layer_surface returns to the state it had right after layer_shell.get_layer_surface. The client can re-map the surface by performing a commit without any buffer attached, waiting for a configure event and handling it as usual.
See also the Event enum for this interface.
Implementations§
source§impl ZwlrLayerSurfaceV1
impl ZwlrLayerSurfaceV1
sourcepub fn set_size(&self, width: u32, height: u32)
pub fn set_size(&self, width: u32, height: u32)
sets the size of the surface
Sets the size of the surface in surface-local coordinates. The compositor will display the surface centered with respect to its anchors.
If you pass 0 for either value, the compositor will assign it and inform you of the assignment in the configure event. You must set your anchor to opposite edges in the dimensions you omit; not doing so is a protocol error. Both values are 0 by default.
Size is double-buffered, see wl_surface.commit.
sourcepub fn set_anchor(&self, anchor: Anchor)
pub fn set_anchor(&self, anchor: Anchor)
configures the anchor point of the surface
Requests that the compositor anchor the surface to the specified edges and corners. If two orthogonal edges are specified (e.g. ‘top’ and ‘left’), then the anchor point will be the intersection of the edges (e.g. the top left corner of the output); otherwise the anchor point will be centered on that edge, or in the center if none is specified.
Anchor is double-buffered, see wl_surface.commit.
sourcepub fn set_exclusive_zone(&self, zone: i32)
pub fn set_exclusive_zone(&self, zone: i32)
configures the exclusive geometry of this surface
Requests that the compositor avoids occluding an area with other surfaces. The compositor’s use of this information is implementation-dependent - do not assume that this region will not actually be occluded.
A positive value is only meaningful if the surface is anchored to one edge or an edge and both perpendicular edges. If the surface is not anchored, anchored to only two perpendicular edges (a corner), anchored to only two parallel edges or anchored to all edges, a positive value will be treated the same as zero.
A positive zone is the distance from the edge in surface-local coordinates to consider exclusive.
Surfaces that do not wish to have an exclusive zone may instead specify how they should interact with surfaces that do. If set to zero, the surface indicates that it would like to be moved to avoid occluding surfaces with a positive exclusive zone. If set to -1, the surface indicates that it would not like to be moved to accommodate for other surfaces, and the compositor should extend it all the way to the edges it is anchored to.
For example, a panel might set its exclusive zone to 10, so that maximized shell surfaces are not shown on top of it. A notification might set its exclusive zone to 0, so that it is moved to avoid occluding the panel, but shell surfaces are shown underneath it. A wallpaper or lock screen might set their exclusive zone to -1, so that they stretch below or over the panel.
The default value is 0.
Exclusive zone is double-buffered, see wl_surface.commit.
sourcepub fn set_margin(&self, top: i32, right: i32, bottom: i32, left: i32)
pub fn set_margin(&self, top: i32, right: i32, bottom: i32, left: i32)
sets a margin from the anchor point
Requests that the surface be placed some distance away from the anchor point on the output, in surface-local coordinates. Setting this value for edges you are not anchored to has no effect.
The exclusive zone includes the margin.
Margin is double-buffered, see wl_surface.commit.
sourcepub fn set_keyboard_interactivity(
&self,
keyboard_interactivity: KeyboardInteractivity,
)
pub fn set_keyboard_interactivity( &self, keyboard_interactivity: KeyboardInteractivity, )
requests keyboard events
Set how keyboard events are delivered to this surface. By default, layer shell surfaces do not receive keyboard events; this request can be used to change this.
This setting is inherited by child surfaces set by the get_popup request.
Layer surfaces receive pointer, touch, and tablet events normally. If you do not want to receive them, set the input region on your surface to an empty region.
Keyboard interactivity is double-buffered, see wl_surface.commit.
sourcepub fn get_popup(&self, popup: &XdgPopup)
pub fn get_popup(&self, popup: &XdgPopup)
assign this layer_surface as an xdg_popup parent
This assigns an xdg_popup’s parent to this layer_surface. This popup should have been created via xdg_surface::get_popup with the parent set to NULL, and this request must be invoked before committing the popup’s initial state.
See the documentation of xdg_popup for more details about what an xdg_popup is and how it is used.
sourcepub fn ack_configure(&self, serial: u32)
pub fn ack_configure(&self, serial: u32)
ack a configure event
When a configure event is received, if a client commits the surface in response to the configure event, then the client must make an ack_configure request sometime before the commit request, passing along the serial of the configure event.
If the client receives multiple configure events before it can respond to one, it only has to ack the last configure event.
A client is not required to commit immediately after sending an ack_configure request - it may even ack_configure several times before its next surface commit.
A client may send multiple ack_configure requests before committing, but only the last request sent before a commit indicates which configure event the client really is responding to.
sourcepub fn set_layer(&self, layer: Layer)
pub fn set_layer(&self, layer: Layer)
change the layer of the surface
Change the layer that the surface is rendered on.
Layer is double-buffered, see wl_surface.commit.
sourcepub fn set_exclusive_edge(&self, edge: Anchor)
pub fn set_exclusive_edge(&self, edge: Anchor)
set the edge the exclusive zone will be applied to
Requests an edge for the exclusive zone to apply. The exclusive edge will be automatically deduced from anchor points when possible, but when the surface is anchored to a corner, it will be necessary to set it explicitly to disambiguate, as it is not possible to deduce which one of the two corner edges should be used.
The edge must be one the surface is anchored to, otherwise the invalid_exclusive_edge protocol error will be raised.
Trait Implementations§
source§impl Borrow<ObjectId> for ZwlrLayerSurfaceV1
impl Borrow<ObjectId> for ZwlrLayerSurfaceV1
source§impl Clone for ZwlrLayerSurfaceV1
impl Clone for ZwlrLayerSurfaceV1
source§fn clone(&self) -> ZwlrLayerSurfaceV1
fn clone(&self) -> ZwlrLayerSurfaceV1
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ZwlrLayerSurfaceV1
impl Debug for ZwlrLayerSurfaceV1
source§impl Hash for ZwlrLayerSurfaceV1
impl Hash for ZwlrLayerSurfaceV1
source§impl PartialEq<Weak<ZwlrLayerSurfaceV1>> for ZwlrLayerSurfaceV1
impl PartialEq<Weak<ZwlrLayerSurfaceV1>> for ZwlrLayerSurfaceV1
source§impl PartialEq for ZwlrLayerSurfaceV1
impl PartialEq for ZwlrLayerSurfaceV1
source§impl Proxy for ZwlrLayerSurfaceV1
impl Proxy for ZwlrLayerSurfaceV1
source§fn data<U: Send + Sync + 'static>(&self) -> Option<&U>
fn data<U: Send + Sync + 'static>(&self) -> Option<&U>
source§fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
source§fn backend(&self) -> &WeakBackend
fn backend(&self) -> &WeakBackend
source§fn send_request(&self, req: Self::Request<'_>) -> Result<(), InvalidId>
fn send_request(&self, req: Self::Request<'_>) -> Result<(), InvalidId>
source§fn send_constructor<I: Proxy>(
&self,
req: Self::Request<'_>,
data: Arc<dyn ObjectData>,
) -> Result<I, InvalidId>
fn send_constructor<I: Proxy>( &self, req: Self::Request<'_>, data: Arc<dyn ObjectData>, ) -> Result<I, InvalidId>
source§fn from_id(conn: &Connection, id: ObjectId) -> Result<Self, InvalidId>
fn from_id(conn: &Connection, id: ObjectId) -> Result<Self, InvalidId>
source§fn inert(backend: WeakBackend) -> Self
fn inert(backend: WeakBackend) -> Self
source§fn parse_event(
conn: &Connection,
msg: Message<ObjectId, OwnedFd>,
) -> Result<(Self, Self::Event), DispatchError>
fn parse_event( conn: &Connection, msg: Message<ObjectId, OwnedFd>, ) -> Result<(Self, Self::Event), DispatchError>
source§fn write_request<'a>(
&self,
conn: &Connection,
msg: Self::Request<'a>,
) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
fn write_request<'a>( &self, conn: &Connection, msg: Self::Request<'a>, ) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
impl Eq for ZwlrLayerSurfaceV1
Auto Trait Implementations§
impl Freeze for ZwlrLayerSurfaceV1
impl !RefUnwindSafe for ZwlrLayerSurfaceV1
impl Send for ZwlrLayerSurfaceV1
impl Sync for ZwlrLayerSurfaceV1
impl Unpin for ZwlrLayerSurfaceV1
impl !UnwindSafe for ZwlrLayerSurfaceV1
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
)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.