summaryrefslogtreecommitdiffstats
path: root/winit/src/application.rs
diff options
context:
space:
mode:
Diffstat (limited to 'winit/src/application.rs')
-rw-r--r--winit/src/application.rs33
1 files changed, 18 insertions, 15 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs
index 52cf7fe8..77e2c83e 100644
--- a/winit/src/application.rs
+++ b/winit/src/application.rs
@@ -213,8 +213,7 @@ where
let mut context = task::Context::from_waker(task::noop_waker_ref());
- #[allow(unused_mut)]
- let mut process_event =
+ let process_event =
move |event, event_loop: &winit::event_loop::EventLoopWindowTarget<_>| {
if event_loop.exiting() {
return;
@@ -244,20 +243,24 @@ where
// since the event loop does not resume during resize interaction.
// More details: https://github.com/rust-windowing/winit/issues/3272
#[cfg(target_os = "windows")]
- let _ = event_loop.run(move |event, event_loop| {
- if matches!(
- event,
- winit::event::Event::WindowEvent {
- event: winit::event::WindowEvent::Resized(_),
- ..
+ {
+ let mut process_event = process_event;
+
+ let _ = event_loop.run(move |event, event_loop| {
+ if matches!(
+ event,
+ winit::event::Event::WindowEvent {
+ event: winit::event::WindowEvent::Resized(_),
+ ..
+ }
+ ) {
+ process_event(event, event_loop);
+ process_event(winit::event::Event::AboutToWait, event_loop);
+ } else {
+ process_event(event, event_loop);
}
- ) {
- process_event(event, event_loop);
- process_event(winit::event::Event::AboutToWait, event_loop);
- } else {
- process_event(event, event_loop);
- }
- });
+ });
+ }
Ok(())
}