summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-08-12 05:20:44 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-08-12 05:20:44 +0200
commit22fc5ce0ea83b43cdccea26afd5e545880dfdaf4 (patch)
treed50980dc2cca6e0f552a6ff4aa2a0363ae5f2c9d
parent01aa84e41afa556fd4e82ef11f2f55cf443ef1aa (diff)
downloadiced-22fc5ce0ea83b43cdccea26afd5e545880dfdaf4.tar.gz
iced-22fc5ce0ea83b43cdccea26afd5e545880dfdaf4.tar.bz2
iced-22fc5ce0ea83b43cdccea26afd5e545880dfdaf4.zip
Produce `window::Event::Closed` on `window::close`
-rw-r--r--winit/src/program.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/winit/src/program.rs b/winit/src/program.rs
index a51f4fd7..66f359f4 100644
--- a/winit/src/program.rs
+++ b/winit/src/program.rs
@@ -754,6 +754,7 @@ async fn run_instance<P, C>(
action,
&program,
&mut compositor,
+ &mut events,
&mut messages,
&mut clipboard,
&mut control_sender,
@@ -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>,
@@ -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 =