mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 21:30:03 -04:00
winit: don't explicitly handle Cmd-Q and Alt-F4 (#881)
Closes https://github.com/emilk/egui/issues/877 Still a problem: https://github.com/rust-windowing/winit/issues/1998
This commit is contained in:
@@ -102,8 +102,9 @@ fn main() {
|
||||
glutin::event::Event::RedrawRequested(_) if !cfg!(windows) => redraw(),
|
||||
|
||||
glutin::event::Event::WindowEvent { event, .. } => {
|
||||
if egui_glium.is_quit_event(&event) {
|
||||
*control_flow = glium::glutin::event_loop::ControlFlow::Exit;
|
||||
use glutin::event::WindowEvent;
|
||||
if matches!(event, WindowEvent::CloseRequested | WindowEvent::Destroyed) {
|
||||
*control_flow = glutin::event_loop::ControlFlow::Exit;
|
||||
}
|
||||
|
||||
egui_glium.on_event(&event);
|
||||
|
||||
@@ -72,8 +72,9 @@ fn main() {
|
||||
glutin::event::Event::RedrawRequested(_) if !cfg!(windows) => redraw(),
|
||||
|
||||
glutin::event::Event::WindowEvent { event, .. } => {
|
||||
if egui_glium.is_quit_event(&event) {
|
||||
*control_flow = glium::glutin::event_loop::ControlFlow::Exit;
|
||||
use glutin::event::WindowEvent;
|
||||
if matches!(event, WindowEvent::CloseRequested | WindowEvent::Destroyed) {
|
||||
*control_flow = glutin::event_loop::ControlFlow::Exit;
|
||||
}
|
||||
|
||||
egui_glium.on_event(&event);
|
||||
|
||||
Reference in New Issue
Block a user