Skip to main content

WindowState

Struct WindowState 

Source
pub struct WindowState {
Show 48 fields pub handle: WindowHandle, pub display_id: Option<DisplayId>, pub kind: WindowKind, pub bounds: WindowBounds, pub viewport_size: Size, pub minimum_size: Option<Size>, pub maximum_size: Option<Size>, pub scale_factor: f32, pub appearance: WindowAppearance, pub background_appearance: WindowBackgroundAppearance, pub macos_vibrancy: Option<MacOsVibrancy>, pub macos_visual_effect_state: MacOsVisualEffectState, pub focused: bool, pub focusable: bool, pub visible: bool, pub minimized: bool, pub maximized: bool, pub fullscreen: bool, pub occluded: bool, pub movable: bool, pub resizable: bool, pub minimizable: bool, pub maximizable: bool, pub closable: bool, pub decorated: bool, pub shadow: bool, pub content_protected: bool, pub window_level: WindowLevel, pub ignore_mouse_events: bool, pub forward_mouse_events: bool, pub window_enabled: bool, pub aspect_ratio: Option<Size>, pub window_buttons_visible: bool, pub skip_taskbar: bool, pub visible_on_all_workspaces: bool, pub opacity: f32, pub has_icon: bool, pub taskbar_progress_state: TaskbarProgressState, pub taskbar_progress: f32, pub has_taskbar_overlay_icon: bool, pub cursor_visible: bool, pub cursor_grab: CursorGrabMode, pub cursor_hit_test: bool, pub cursor_position: Option<Point>, pub represented_file: bool, pub document_edited: bool, pub native_tabbing: bool, pub native_tabs: WindowTabState,
}
Expand description

Retained native state available during declarative rendering.

Fields§

§handle: WindowHandle§display_id: Option<DisplayId>

Display currently containing the native window, when known.

§kind: WindowKind§bounds: WindowBounds§viewport_size: Size§minimum_size: Option<Size>

Effective native minimum inner size, or None when unconstrained.

§maximum_size: Option<Size>

Effective native maximum inner size, or None when unconstrained.

§scale_factor: f32§appearance: WindowAppearance§background_appearance: WindowBackgroundAppearance§macos_vibrancy: Option<MacOsVibrancy>

Active macOS semantic vibrancy material, when requested.

§macos_visual_effect_state: MacOsVisualEffectState§focused: bool§focusable: bool

Whether the native window is permitted to receive keyboard focus.

§visible: bool§minimized: bool§maximized: bool§fullscreen: bool§occluded: bool§movable: bool§resizable: bool§minimizable: bool§maximizable: bool§closable: bool§decorated: bool§shadow: bool§content_protected: bool§window_level: WindowLevel§ignore_mouse_events: bool

Whether native pointer events pass through this window to whatever is behind it.

§forward_mouse_events: bool

Whether pointer motion is still delivered to this window while clicks pass through.

§window_enabled: bool

Whether the native window currently accepts any input at all.

§aspect_ratio: Option<Size>

Retained content aspect ratio as width:height, or None when unconstrained.

§window_buttons_visible: bool

Whether the macOS close/minimize/zoom buttons are visible.

§skip_taskbar: bool

Whether this window is omitted from the taskbar on supported platforms.

§visible_on_all_workspaces: bool

Whether this window follows the user across virtual desktops/spaces.

§opacity: f32

Whole-window native alpha in the inclusive 0.0..=1.0 range.

§has_icon: bool

Whether an explicit native window icon is installed.

§taskbar_progress_state: TaskbarProgressState

Retained taskbar progress mode and bounded completion value.

§taskbar_progress: f32§has_taskbar_overlay_icon: bool

Whether a Windows taskbar overlay icon is installed.

§cursor_visible: bool§cursor_grab: CursorGrabMode§cursor_hit_test: bool

Whether the native window participates in pointer hit testing.

§cursor_position: Option<Point>

Last known pointer position in logical window coordinates.

§represented_file: bool

Whether the native titlebar currently represents a document file.

§document_edited: bool

Whether native chrome indicates that the represented document has unsaved changes.

§native_tabbing: bool

Whether this window opted into native system tabbing.

§native_tabs: WindowTabState

Bounded cached state for the native AppKit tab group.

Implementations§

Source§

impl WindowState

Source

pub fn restore_state(&self, displays: &Displays) -> WindowRestoreState

Capture persistable geometry and display identity for this window.

The rectangle is the windowed restore geometry, so a maximized or fullscreen window still persists the size it returns to. Pass the result to WindowOptions::restore on the next launch.

Trait Implementations§

Source§

impl Clone for WindowState

Source§

fn clone(&self) -> WindowState

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for WindowState

Source§

impl Debug for WindowState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for WindowState

Source§

fn eq(&self, other: &WindowState) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for WindowState

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Action for T
where T: Clone + PartialEq + 'static,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TryClone for T
where T: Clone,

Source§

fn try_clone(&self) -> Result<T, Error>

Clones self, possibly returning an error.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more