Revert window::close producing a window::Id

Instead, subscribing to `window::close_events` is
preferable; since most use cases will want to react
to the user closing a window as well.
This commit is contained in:
Héctor Ramón Jiménez 2024-08-12 05:50:22 +02:00
parent 22fc5ce0ea
commit 8b45d620d0
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
4 changed files with 7 additions and 12 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).discard()
window::get_latest().and_then(window::close)
} else {
Task::none()
}
@ -47,9 +47,7 @@ impl Events {
Task::none()
}
Message::Exit => {
window::get_latest().and_then(window::close).discard()
}
Message::Exit => window::get_latest().and_then(window::close),
}
}

View file

@ -20,9 +20,7 @@ enum Message {
impl Exit {
fn update(&mut self, message: Message) -> Task<Message> {
match message {
Message::Confirm => {
window::get_latest().and_then(window::close).discard()
}
Message::Confirm => window::get_latest().and_then(window::close),
Message::Exit => {
self.show_confirm = true;