pub enum WindowEvent {
CloseRequested,
Resized(Size),
Moved(Point),
ScaleFactorChanged {
scale_factor: f64,
raw_dpi: Option<f32>,
suggested_size: Option<Size>,
},
SafeAreaChanged(SafeAreaInsets),
Focused(bool),
Occluded(bool),
ExternalFileHovered(PathBuf),
ExternalFileHoverCancelled,
ExternalFileDropped(PathBuf),
RedrawRequested,
}Variants§
CloseRequested
The host target should close. The target is identified by the
WindowId attached to the delivery path rather than by this event.
Resized(Size)
The host target’s viewport changed size. The target may be a native window or an embedded viewport/region.
Moved(Point)
The native desktop window moved to a new physical desktop position. Embedded and web hosts may never emit this event.
ScaleFactorChanged
SafeAreaChanged(SafeAreaInsets)
The unobscured inset from each viewport edge changed, usually after a mobile rotation, browser viewport update, or host embedding change.
Focused(bool)
Occluded(bool)
ExternalFileHovered(PathBuf)
A file from outside the application is being hovered over the host window. Platforms emit one event per file when several files are dragged together.
ExternalFileHoverCancelled
Files from outside the application left the host window without being dropped.
ExternalFileDropped(PathBuf)
A file from outside the application was dropped on the host window. Platforms emit one event per file when several files are dropped together.