pub enum WindowVisibility {
Visible,
Hidden,
}Expand description
Whether the platform is presenting a window’s frames.
This is about presentation, not the window’s shown/hidden state: a shown
window that is fully covered by other windows, minimized, on another
Space or virtual desktop, or on a display that is asleep is Hidden. A
window only partly covered by other windows is Visible.
Each platform reports from a single source, and what that source can see differs:
- macOS:
NSWindow.occlusionState. Covers all of the cases above. - Windows:
WS_VISIBLEand the minimized state. Windows keeps compositing covered windows for thumbnails and Alt-Tab and offers no occlusion notification, so a fully covered window staysVisible. Display sleep is not reported either. - Wayland: the
xdg_toplevelsuspendedstate (xdg-shell v6). Compositors that don’t support it never reportHidden. - X11: mapped state plus
VisibilityNotify. Compositing window managers generally never report a window as fully obscured, so covering is only detected without compositing.
Variants§
Visible
At least part of the window is being presented; frames drawn for it will be shown.
Hidden
No part of the window is being presented. The platform will not request frames for it until it becomes visible again.
Implementations§
Source§impl WindowVisibility
impl WindowVisibility
Sourcepub fn is_visible(self) -> bool
pub fn is_visible(self) -> bool
Whether frames drawn for the window will be shown.
Trait Implementations§
Source§impl Clone for WindowVisibility
impl Clone for WindowVisibility
Source§fn clone(&self) -> WindowVisibility
fn clone(&self) -> WindowVisibility
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for WindowVisibility
Source§impl Debug for WindowVisibility
impl Debug for WindowVisibility
impl Eq for WindowVisibility
Source§impl PartialEq for WindowVisibility
impl PartialEq for WindowVisibility
impl StructuralPartialEq for WindowVisibility
Auto Trait Implementations§
impl Freeze for WindowVisibility
impl RefUnwindSafe for WindowVisibility
impl Send for WindowVisibility
impl Sync for WindowVisibility
impl Unpin for WindowVisibility
impl UnsafeUnpin for WindowVisibility
impl UnwindSafe for WindowVisibility
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more