Skip to main content

WindowAttributesExtWayland

Trait WindowAttributesExtWayland 

pub trait WindowAttributesExtWayland {
    // Required methods
    fn with_name(
        self,
        general: impl Into<String>,
        instance: impl Into<String>,
    ) -> Self;
    fn with_layer_surface(self, attributes: LayerSurfaceAttributes) -> Self;
    fn with_session_lock(self) -> Self;
}
Expand description

Additional methods on WindowAttributes that are specific to Wayland.

Required Methods§

fn with_name( self, general: impl Into<String>, instance: impl Into<String>, ) -> Self

Build window with the given name.

The general name sets an application ID, which should match the .desktop file distributed with your program. The instance is a no-op.

For details about application ID conventions, see the Desktop Entry Spec

fn with_layer_surface(self, attributes: LayerSurfaceAttributes) -> Self

Make this window a surface on a layer of its output instead of a toplevel the desktop places.

A session’s own surfaces — a bar, a desk, a panel, a quick settings sheet — say where they go themselves: which layer, which edges they are anchored to, how much of the edge they reserve for the desktop to keep windows out of. The compositor composites them like any other client’s surface.

The attributes that only a toplevel has (a title, client side decorations, minimizing, maximizing, fullscreen, moving, a window menu) are ignored. The surface is configured with the size its anchors give it, like any layer surface.

fn with_session_lock(self) -> Self

Make this window the session’s lock screen instead of a toplevel the desktop places.

The window asks the compositor for the session’s lock when it is created: once every output shows it and nothing else draws, the window gets its surface, sized to the output, and every input goes to it. Leaving the lock is the window’s own request (WindowExtWayland::unlock_session), after it established that the person may.

The attributes that only a toplevel has (a title, client side decorations, minimizing, maximizing, fullscreen, moving, a window menu) are ignored.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§