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.