wayland_window

Struct Frame

Source
pub struct Frame { /* private fields */ }
Expand description

A decorated frame for a window

This object allows you to interact with the shell_surface and frame.

You’ll at least need to use it to resize the borders when you window is resized.

Dropping it will remove your window and unmap your wl_surface.

Implementations§

Source§

impl Frame

Source

pub fn refresh(&mut self)

Refreshes the frame

Redraws the frame to match its requested state (dimensions, presence/ absence of decorations, …)

If the frame does not need a redraw, this method will do nothing, so don’t be afraid to call it frequently.

You need to call this method after every change to the dimensions or state of the decorations of your window, otherwise the drawn decorations may go out of sync with the state of your content.

Source

pub fn set_title(&self, title: String)

Set a short title for the window.

This string may be used to identify the surface in a task bar, window list, or other user interface elements provided by the compositor.

Source

pub fn set_app_id(&self, app_id: String)

Set an app id for the surface.

The surface class identifies the general class of applications to which the surface belongs.

Several wayland compositors will try to find a .desktop file matching this name to find metadata about your apps.

Source

pub fn set_decorate(&mut self, decorate: bool)

Set wether the window should be decorated or not

You need to call refresh() afterwards for this to properly take effect.

Source

pub fn resize(&mut self, w: i32, h: i32)

Resize the decorations

You should call this whenever you change the size of the contents of your window, with the new inner size of your window.

You need to call refresh() afterwards for this to properly take effect.

Source

pub fn set_state(&mut self, state: State<'_>)

Sets the requested state of this surface

Source

pub fn set_min_size(&mut self, size: Option<(i32, i32)>)

Sets the minimum possible size for this window

Provide either a tuple Some((width, height)) or None to unset the minimum size.

The provided size is the interior size, not counting decorations

Source

pub fn set_max_size(&mut self, size: Option<(i32, i32)>)

Sets the maximum possible size for this window

Provide either a tuple Some((width, height)) or None to unset the maximum size.

The provided size is the interior size, not counting decorations

Trait Implementations§

Source§

impl Drop for Frame

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Frame

§

impl RefUnwindSafe for Frame

§

impl Send for Frame

§

impl Sync for Frame

§

impl Unpin for Frame

§

impl UnwindSafe for Frame

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>,

Source§

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>,

Source§

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.