summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--native/src/window/event.rs6
-rw-r--r--winit/src/conversion.rs3
2 files changed, 9 insertions, 0 deletions
diff --git a/native/src/window/event.rs b/native/src/window/event.rs
index fc746781..3aa1ab0b 100644
--- a/native/src/window/event.rs
+++ b/native/src/window/event.rs
@@ -12,6 +12,12 @@ pub enum Event {
height: u32,
},
+ /// The user has requested for the window to close.
+ ///
+ /// Usually, you will want to terminate the execution whenever this event
+ /// occurs.
+ CloseRequested,
+
/// A window was focused.
Focused,
diff --git a/winit/src/conversion.rs b/winit/src/conversion.rs
index 0e04b35d..0fa27413 100644
--- a/winit/src/conversion.rs
+++ b/winit/src/conversion.rs
@@ -33,6 +33,9 @@ pub fn window_event(
height: logical_size.height,
}))
}
+ WindowEvent::CloseRequested => {
+ Some(Event::Window(window::Event::CloseRequested))
+ }
WindowEvent::CursorMoved { position, .. } => {
let position = position.to_logical::<f64>(scale_factor);