Skip to main content

WindowOps

Trait WindowOps 

Source
pub trait WindowOps {
    // Required methods
    fn displays(&self) -> Result<Vec<Rect>, OffscreenError>;
    fn frame(&self) -> Result<Rect, OffscreenError>;
    fn backing_scale(&self) -> Result<f64, OffscreenError>;
    fn is_visible(&self) -> Result<bool, OffscreenError>;
    fn is_miniaturized(&self) -> Result<bool, OffscreenError>;
    fn set_origin(&mut self, x: f64, y: f64) -> Result<(), OffscreenError>;
    fn show(&mut self) -> Result<(), OffscreenError>;

    // Provided methods
    fn precheck(&self) -> Result<(), OffscreenError> { ... }
    fn hide_for_restore(&mut self) -> Result<(), OffscreenError> { ... }
}
Expand description

Window operations the placement logic needs. Implemented by the native windows and by fakes in tests.

Required Methods§

Source

fn displays(&self) -> Result<Vec<Rect>, OffscreenError>

Source

fn frame(&self) -> Result<Rect, OffscreenError>

Source

fn backing_scale(&self) -> Result<f64, OffscreenError>

Source

fn is_visible(&self) -> Result<bool, OffscreenError>

Source

fn is_miniaturized(&self) -> Result<bool, OffscreenError>

Source

fn set_origin(&mut self, x: f64, y: f64) -> Result<(), OffscreenError>

Source

fn show(&mut self) -> Result<(), OffscreenError>

Make the window visible to the window server without activating the app.

Provided Methods§

Source

fn precheck(&self) -> Result<(), OffscreenError>

Checks before any move (Windows: refuse a minimized window or one owned by another process).

Source

fn hide_for_restore(&mut self) -> Result<(), OffscreenError>

Take the window off screen before it is moved back (macOS orderOut:, so the restore never flashes on a display; Windows ShowWindow(SW_HIDE)). Default no-op.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§