Skip to main content

HostWindow

Trait HostWindow 

Source
pub trait HostWindow: 'static {
    // Required methods
    fn view(&self) -> ViewRef;
    fn frame(&self) -> Rect;
    fn set_frame(&self, frame: Rect, animate: Option<Duration>);
    fn set_title(&self, title: &str);
    fn show(&self);
    fn hide(&self);
    fn is_minimized(&self) -> bool;
    fn is_occluded(&self) -> bool;
    fn close(&self);
    fn native_handle(&self) -> Option<RawWindowHandle>;
}
Expand description

The window around a view the host puts on screen in a window the app may manage.

Required Methods§

Source

fn view(&self) -> ViewRef

Source

fn frame(&self) -> Rect

The window’s logical frame in screen space.

Source

fn set_frame(&self, frame: Rect, animate: Option<Duration>)

Moves and sizes the window, over animate when the host can animate a frame.

Source

fn set_title(&self, title: &str)

Source

fn show(&self)

Source

fn hide(&self)

Source

fn is_minimized(&self) -> bool

Flutter WindowController.isMinimized; macOS isMiniaturized, Windows IsIconic. false where the system does not tell a client, as Wayland does not.

Source

fn is_occluded(&self) -> bool

Covered all over, or otherwise not shown: macOS’s occlusion state without its visible bit, winit’s Occluded. Not in Flutter’s controller; Inset’s, after the platforms. false where the system does not tell a window, as Windows and Wayland do not.

Source

fn close(&self)

Closes the window; its view goes away with it. The user’s asking to close it only reports it (EmbedderClient::view_close_requested); this closes it.

Source

fn native_handle(&self) -> Option<RawWindowHandle>

The native window, for configuration this interface does not carry.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§