diff --git a/gui/Cargo.lock b/gui/Cargo.lock index 175d3da7..2cca4471 100644 --- a/gui/Cargo.lock +++ b/gui/Cargo.lock @@ -1750,8 +1750,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "215d51fa4f70dbb63775d7141243c4d98d4d525d8949695601f8fbac7dcbc04e" +source = "git+https://github.com/edouardparis/iced?branch=fix-futures-recipe#2d8318b13bdf8aaf31bc6d5a72b22313ed2d10cf" dependencies = [ "futures", "log", diff --git a/gui/Cargo.toml b/gui/Cargo.toml index 1668aff0..07c2d558 100644 --- a/gui/Cargo.toml +++ b/gui/Cargo.toml @@ -47,6 +47,9 @@ bitcoin_hashes = "0.12" reqwest = { version = "0.11", default-features=false, features = ["rustls-tls"] } rust-ini = "0.19.0" +[patch.crates-io] +iced_futures = { git = "https://github.com/edouardparis/iced", branch = "fix-futures-recipe"} + [target.'cfg(windows)'.dependencies] zip = { version = "0.6", default-features=false, features = ["bzip2", "deflate"] } diff --git a/gui/src/main.rs b/gui/src/main.rs index c70f669d..efde6ab6 100644 --- a/gui/src/main.rs +++ b/gui/src/main.rs @@ -259,18 +259,14 @@ impl Application for GUI { State::App(v) => v.subscription().map(|msg| Message::Run(Box::new(msg))), State::Launcher(v) => v.subscription().map(|msg| Message::Launch(Box::new(msg))), }, - iced_native::subscription::events_with(|event, _status| { - if matches!( - event, - iced::Event::Window(iced_native::window::Event::CloseRequested) - ) { - Some(event) - } else { - None - } - }) - .map(Self::Message::Event), + iced_native::subscription::events().map(Self::Message::Event), ]) + .with_filter(|(event, _status)| { + matches!( + event, + iced::Event::Window(iced_native::window::Event::CloseRequested) + ) + }) } fn view(&self) -> Element {