#[non_exhaustive]
pub enum Request { SetSize { width: u32, height: u32, }, SetAnchor { anchor: Anchor, }, SetExclusiveZone { zone: i32, }, SetMargin { top: i32, right: i32, bottom: i32, left: i32, }, SetKeyboardInteractivity { keyboard_interactivity: KeyboardInteractivity, }, GetPopup { popup: XdgPopup, }, AckConfigure { serial: u32, }, Destroy, SetLayer { layer: Layer, }, }

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

SetSize

Fields

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

§

SetAnchor

Fields

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

§

SetExclusiveZone

Fields

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

§

SetMargin

Fields

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

§

SetKeyboardInteractivity

Fields

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

§

GetPopup

Fields

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

§

AckConfigure

Fields

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

§

Destroy

destroy the layer_surface

This request destroys the layer surface.

This is a destructor, once sent this object cannot be used any longer.

§

SetLayer

Fields

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

Only available since version 2 of the interface

Trait Implementations§

source§

impl Debug for Request

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl MessageGroup for Request

source§

const MESSAGES: &'static [MessageDesc] = _

Wire representation of this MessageGroup
§

type Map = ProxyMap

The wrapper type for ObjectMap allowing the mapping of Object and NewId arguments to the object map during parsing.
source§

fn is_destructor(&self) -> bool

Whether this message is a destructor Read more
source§

fn opcode(&self) -> u16

The opcode of this message
source§

fn since(&self) -> u32

The minimal object version for which this message exists
source§

fn child<Meta: ObjectMetadata>( opcode: u16, version: u32, meta: &Meta ) -> Option<Object<Meta>>

Retrieve the child Object associated with this message if any
source§

fn from_raw(msg: Message, map: &mut Self::Map) -> Result<Self, ()>

Construct a message from its raw representation
source§

fn into_raw(self, sender_id: u32) -> Message

Turn this message into its raw representation
source§

unsafe fn from_raw_c( obj: *mut c_void, opcode: u32, args: *const wl_argument ) -> Result<Request, ()>

Construct a message of this group from its C representation Read more
source§

fn as_raw_c_in<F, T>(self, f: F) -> T
where F: FnOnce(u32, &mut [wl_argument]) -> T,

Build a C representation of this message Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.