pub enum WindowCommand {
StartDrag(WindowId),
Close(WindowId),
Minimize(WindowId),
ToggleMaximize(WindowId),
Open {
id: WindowId,
owner: WindowId,
origin: OriginId,
config: WindowConfig,
},
SetSize {
window: WindowId,
size: Size,
},
Focus(WindowId),
Redraw(WindowId),
}Expand description
A window-level intent for the frame driver, drained with
Core::take_window_commands after each input dispatch and each frame.
Three things produce one: input on a chrome node, the diff of the
declared window set, and an app asking directly (Core::set_window_size,
Core::focus_window, Core::push_window_command). A headless driver
never drains.
Every variant says which window it is about (WindowCommand::window)
and is Copy: an Open carries no title (the new window’s first frame
declares one through window_title).
Variants§
StartDrag(WindowId)
Begin an interactive OS move (the press landed on a Drag node).
Close(WindowId)
Close this window: from its chrome close button, or because no frame declares it any more. For the main window a driver exits.
Minimize(WindowId)
ToggleMaximize(WindowId)
Open
Open a window the declared set gained. id is the one the core
assigned and will stamp on the window’s events; origin is the
frontend whose declaration won (a host may refuse an extension’s);
owner is the window whose frame that declaration came from — what
a WindowKind::Popup is anchored against and owned by, and what
closing takes the popup with it (the owner’s declarations leave the
declared set when the owner does, so the diff closes the child in
the same pass).
SetSize
Resize window to size (logical px), asked for by the app
(Core::set_window_size). A command rather than part of the
declaration, because the user owns a window’s size once it exists.
The OS may answer with a different size (a minimum, a tiling
manager); the frame that follows posts a resize event with
whatever it actually became.
Focus(WindowId)
Give window keyboard focus (Core::focus_window). Advisory, like
every focus request an app makes of a window manager.
Redraw(WindowId)
Draw window again: something another window’s frame or input
changed is shown there (the devtools window’s row hover outlines a
node in the main window). A driver that redraws every window on
every event may ignore it.