1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

Now a WindowEvent::CloseRequested is received will be sent to egui_winit::State in RawInput

Now when we press the close button from a native window if the window has a open variabile connected the window will be closed
This commit is contained in:
Konkitoman
2023-07-24 16:15:34 +03:00
parent 4d883b8217
commit f4a196cddc
6 changed files with 106 additions and 16 deletions

View File

@@ -449,13 +449,14 @@ impl EpiIntegration {
event: &winit::event::WindowEvent<'_>,
window_id: &winit::window::WindowId,
egui_winit: &mut egui_winit::State,
viewport_id: u64,
) -> EventResponse {
use winit::event::{ElementState, MouseButton, WindowEvent};
match event {
WindowEvent::CloseRequested => {
log::debug!("Received WindowEvent::CloseRequested");
self.close = app.on_close_event();
self.close = app.on_close_event() && viewport_id == 0;
log::debug!("App::on_close_event returned {}", self.close);
}
WindowEvent::Destroyed => {