Make window::close return and introduce Task::discard

This commit is contained in:
Héctor Ramón Jiménez 2024-08-12 05:12:42 +02:00
parent 7740c35a2a
commit 01aa84e41a
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
5 changed files with 24 additions and 7 deletions

View file

@ -37,7 +37,7 @@ impl Events {
}
Message::EventOccurred(event) => {
if let Event::Window(window::Event::CloseRequested) = event {
window::get_latest().and_then(window::close)
window::get_latest().and_then(window::close).discard()
} else {
Task::none()
}
@ -47,7 +47,9 @@ impl Events {
Task::none()
}
Message::Exit => window::get_latest().and_then(window::close),
Message::Exit => {
window::get_latest().and_then(window::close).discard()
}
}
}