1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40: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:
Emil Ernerfeldt
2021-11-07 20:58:02 +01:00
committed by GitHub
parent 19d24bbebe
commit ddd5f6f4f6
12 changed files with 14 additions and 49 deletions

View File

@@ -5,6 +5,7 @@ All notable changes to the `egui_glow` integration will be noted in this file.
## Unreleased
* Make winit/glutin an optional dependency ([#868](https://github.com/emilk/egui/pull/868)).
* Simplify `EguiGlow` interface ([#871](https://github.com/emilk/egui/pull/871)).
* Remove `EguiGlow::is_quit_event` ([#881](https://github.com/emilk/egui/pull/881)).
## 0.15.0 - 2021-10-24

View File

@@ -90,7 +90,8 @@ fn main() {
glutin::event::Event::RedrawRequested(_) if !cfg!(windows) => redraw(),
glutin::event::Event::WindowEvent { event, .. } => {
if egui_glow.is_quit_event(&event) {
use glutin::event::WindowEvent;
if matches!(event, WindowEvent::CloseRequested | WindowEvent::Destroyed) {
*control_flow = glutin::event_loop::ControlFlow::Exit;
}

View File

@@ -1,6 +1,4 @@
use crate::*;
#[cfg(target_os = "windows")]
use glutin::platform::windows::WindowBuilderExtWindows;
struct RequestRepaintEvent;

View File

@@ -141,11 +141,6 @@ impl EguiGlow {
self.egui_winit.on_event(&self.egui_ctx, event)
}
/// Is this a close event or a Cmd-Q/Alt-F4 keyboard command?
pub fn is_quit_event(&self, event: &glutin::event::WindowEvent<'_>) -> bool {
self.egui_winit.is_quit_event(event)
}
/// Returns `needs_repaint` and shapes to draw.
pub fn run(
&mut self,