From 7987920f7e85b84d19a802bdebaa07a7a1633477 Mon Sep 17 00:00:00 2001 From: Erdal Acar <47061357+erac0@users.noreply.github.com> Date: Sun, 29 May 2022 20:37:31 +0200 Subject: [PATCH] Fix exit handling (#1696) --- eframe/src/native/run.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eframe/src/native/run.rs b/eframe/src/native/run.rs index 0b8f8245..5fb69425 100644 --- a/eframe/src/native/run.rs +++ b/eframe/src/native/run.rs @@ -187,7 +187,7 @@ pub fn run_glow( winit::event::WindowEvent::ScaleFactorChanged { new_inner_size, .. } => { gl_window.resize(**new_inner_size); } - winit::event::WindowEvent::CloseRequested => { + winit::event::WindowEvent::CloseRequested if integration.should_quit() => { *control_flow = winit::event_loop::ControlFlow::Exit; } _ => {} @@ -363,7 +363,7 @@ pub fn run_wgpu( winit::event::WindowEvent::ScaleFactorChanged { new_inner_size, .. } => { painter.on_window_resized(new_inner_size.width, new_inner_size.height); } - winit::event::WindowEvent::CloseRequested => { + winit::event::WindowEvent::CloseRequested if integration.should_quit() => { *control_flow = winit::event_loop::ControlFlow::Exit; } _ => {}