Expand description
Several windows in one process.
A window is a node: a Window child of the root, whose children are that window’s
content. All the windows share one composition, one Host and one node table, so a state
one window’s handler writes is read by every window that reads it, and the batch that
results carries every window’s change.
This module holds what is not a node. A WindowHandle names the window the caller is
in and carries the commands that happen once (bring it forward, give it a theme, change
its zoom). WindowEvent is what a window reports. The root hears two events that
belong to no window, a window the system made or restored and the application being
opened again with none, through the registrations at the bottom.
Everything is keyed by the id of the Window node, the number the Renderer reports a
window’s events under, so one window’s size, zoom and theme never reach another’s.
Re-exports§
pub use crate::schema::LastWindowClosed;pub use crate::schema::WindowMode;
Structs§
- Application
Reopen Subscription - A registration for the application being opened again while it has no window. Dropping it removes the handler.
- Drag
From Pointer - Opens a window under a pointer that is held down and has it follow the pointer until it is let go.
- Window
Drag Event - A torn-off window being dragged.
- Window
Drag Over - A dragged window passing over a node that listens for it.
- Window
Frame - A window’s outer frame, in screen dp.
- Window
Handle - A window of the application, named by the id of its
Windownode. - Window
Request - A window the application has no node for yet: the system made it, or brought it back after the process was killed, or the user asked for a new one.
- Window
Request Subscription - A registration for windows the application has no node for. Dropping it removes the handler.
Enums§
- Window
Drag Over Kind - What a dragged window is doing over a node that listens for it.
- Window
Drag Phase - The phase of a torn-off window being dragged.
- Window
Event - What a window reports to the handler registered for it.
Functions§
- current_
window - The window the caller is in, or
Noneoutside anyWindow(and so always in an application that has one window). - on_
application_ reopen_ handler - Runs
handlerwhen the user opens the application again while it has no window, which is the Dock icon on macOS. - on_
window_ request - Runs
handlerfor each window the system or the user made that the application has no node for, for as long as the returned registration is kept. The handler puts aWindownode with thatRestoreKeyinto the tree in the same call, or the Renderer closes the window.