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: WindowIdWhich 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: boolThe host asked the app to draw its own chrome (no native titlebar).
maximized: bool§fullscreen: bool§always_on_top: boolThe 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: BackdropWhat 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§
impl Copy for WindowEnv
impl StructuralPartialEq for WindowEnv
Auto Trait Implementations§
impl Freeze for WindowEnv
impl RefUnwindSafe for WindowEnv
impl Send for WindowEnv
impl Sync for WindowEnv
impl Unpin for WindowEnv
impl UnsafeUnpin for WindowEnv
impl UnwindSafe for WindowEnv
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.