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§
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>
Sourcefn show(&mut self) -> Result<(), OffscreenError>
fn show(&mut self) -> Result<(), OffscreenError>
Make the window visible to the window server without activating the app.
Provided Methods§
Sourcefn precheck(&self) -> Result<(), OffscreenError>
fn precheck(&self) -> Result<(), OffscreenError>
Checks before any move (Windows: refuse a minimized window or one owned by another process).
Sourcefn hide_for_restore(&mut self) -> Result<(), OffscreenError>
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".