Merge #689: gui: use patch for iced_futures

eebf0c20350554f422a028076a460b19f88a7c34 contrib: adapt GUIX build for iced_futures patch (edouard)
df849ba960ace67615a452970ffd2f323a53974e gui: use patch for iced_futures (edouard)

Pull request description:

  from #685

ACKs for top commit:
  darosior:
    ACK eebf0c20350554f422a028076a460b19f88a7c34 -- that's a clean backport of #685 (which i ack'd) and of #687 (which i authored).

Tree-SHA512: e80777417dad0301ce6b9762b2fac02a684e3ce312ad77509e5f2457bfdd11f93d46108fe7bed451eeacf7cc0f3703a8cfa8e18e2dda8f193e704a44c42d019a
This commit is contained in:
edouard 2023-09-07 10:51:01 +02:00
commit 338195a186
No known key found for this signature in database
GPG Key ID: E65F7A089C20DC8F
4 changed files with 16 additions and 13 deletions

View File

@ -17,6 +17,11 @@ replace-with = "vendored_sources"
git = "https://github.com/wizardsardine/liana"
branch = "master"
replace-with = "vendored_sources"
[source."https://github.com/edouardparis/iced"]
git = "https://github.com/edouardparis/iced"
branch = "fix-futures-recipe"
replace-with = "vendored_sources"
EOF
# We need to set RUSTC_BOOTSTRAP=1 as a workaround to be able to use unstable

3
gui/Cargo.lock generated
View File

@ -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",

View File

@ -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"] }

View File

@ -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<Self::Message> {