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
impl Frame
Sourcepub fn refresh(&mut self)
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.
Sourcepub fn set_title(&self, title: String)
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.
Sourcepub fn set_app_id(&self, app_id: String)
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.
Sourcepub fn set_decorate(&mut self, decorate: bool)
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.
Sourcepub fn resize(&mut self, w: i32, h: i32)
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.
Sourcepub fn set_min_size(&mut self, size: Option<(i32, i32)>)
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
Sourcepub fn set_max_size(&mut self, size: Option<(i32, i32)>)
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