Skip to main content

Module windows

Module windows 

Source
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§

ApplicationReopenSubscription
A registration for the application being opened again while it has no window. Dropping it removes the handler.
DragFromPointer
Opens a window under a pointer that is held down and has it follow the pointer until it is let go.
WindowDragEvent
A torn-off window being dragged.
WindowDragOver
A dragged window passing over a node that listens for it.
WindowFrame
A window’s outer frame, in screen dp.
WindowHandle
A window of the application, named by the id of its Window node.
WindowRequest
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.
WindowRequestSubscription
A registration for windows the application has no node for. Dropping it removes the handler.

Enums§

WindowDragOverKind
What a dragged window is doing over a node that listens for it.
WindowDragPhase
The phase of a torn-off window being dragged.
WindowEvent
What a window reports to the handler registered for it.

Functions§

current_window
The window the caller is in, or None outside any Window (and so always in an application that has one window).
on_application_reopen_handler
Runs handler when the user opens the application again while it has no window, which is the Dock icon on macOS.
on_window_request
Runs handler for 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 a Window node with that RestoreKey into the tree in the same call, or the Renderer closes the window.