Skip to content

Commit

Permalink
Produce window::Event::Closed on window::close
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Aug 12, 2024
1 parent 01aa84e commit 22fc5ce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion winit/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ async fn run_instance<P, C>(
action,
&program,
&mut compositor,
&mut events,
&mut messages,
&mut clipboard,
&mut control_sender,
Expand Down Expand Up @@ -1161,6 +1162,7 @@ fn run_action<P, C>(
action: Action<P::Message>,
program: &P,
compositor: &mut C,
events: &mut Vec<(window::Id, core::Event)>,
messages: &mut Vec<P::Message>,
clipboard: &mut Clipboard,
control_sender: &mut mpsc::UnboundedSender<Control>,
Expand Down Expand Up @@ -1212,8 +1214,12 @@ fn run_action<P, C>(
window::Action::Close(id, channel) => {
let _ = window_manager.remove(id);
let _ = ui_caches.remove(&id);

let _ = channel.send(id);

events.push((
id,
core::Event::Window(core::window::Event::Closed),
));
}
window::Action::GetOldest(channel) => {
let id =
Expand Down

0 comments on commit 22fc5ce

Please sign in to comment.