Skip to main content

WindowEnv

Struct WindowEnv 

Source
pub struct WindowEnv {
    pub id: WindowId,
    pub custom_chrome: bool,
    pub maximized: bool,
    pub fullscreen: bool,
    pub always_on_top: bool,
    pub native_controls: Option<Rect>,
    pub backdrop: Backdrop,
}
Expand description

What the host knows about its window, pushed into Env by the frame driver. Views (e.g. widgets::titlebar) read this to adapt: reserve space for native controls, pick the maximize/restore glyph, or render nothing at all under native decorations.

Fields§

§id: WindowId

Which window this core is drawing: the id the Open that created it carried, written here by the driver (MAIN for the launcher’s). A view reads it here rather than through a query, and it is what the core stamps onto every UiEvent it hands out — so a driver that pushes the rest of these facts has already said where its events came from. The window’s name is Core::window_name.

§custom_chrome: bool

The host asked the app to draw its own chrome (no native titlebar).

§maximized: bool§fullscreen: bool§always_on_top: bool

The window is above every other app’s: the level the driver set after the frame asked (Core::set_always_on_top), on a platform that has one. On Wayland there is no such call, so a driver reports false however often the app asks, which is why a pin button should draw its state from this field. It is the driver’s record of what it set, not a query: a level the OS dropped afterwards (a fullscreen space, a tiling manager) is not seen here.

§native_controls: Option<Rect>

Area (logical px, window coords) covered by controls the OS still draws over our content — macOS traffic lights under custom chrome. Views keep out of it; None means the OS draws nothing over us.

§backdrop: Backdrop

What is behind the window’s transparent pixels, as the driver got it — not as the app asked: a Blur asked of GNOME reads Tinted (the wallpaper, drawn by kui) or Opaque where no wallpaper could be read. A view that paints translucent regions over the backdrop paints them opaque when this is Opaque (backlog F126). Opaque by default and in a headless core.

Trait Implementations§

Source§

impl Clone for WindowEnv

Source§

fn clone(&self) -> Self

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 WindowEnv

Source§

impl Debug for WindowEnv

Source§

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

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

impl Default for WindowEnv

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for WindowEnv

Source§

fn eq(&self, other: &Self) -> 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 WindowEnv

Auto Trait Implementations§

Blanket Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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, 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.