Update winit and glutin dependencies

... and remove crates.io patch
This commit is contained in:
Héctor Ramón Jiménez 2021-07-20 21:34:20 +07:00
parent b97954a1ee
commit 82db3c78b6
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
4 changed files with 9 additions and 19 deletions

View file

@ -93,9 +93,6 @@ iced_core = { version = "0.4", path = "core" }
iced_futures = { version = "0.3", path = "futures" }
thiserror = "1.0"
[patch.crates-io]
winit = { git = "https://github.com/iced-rs/winit", rev = "327c8756f90953a6a03f818113f8566176e6eb0d"}
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
iced_winit = { version = "0.3", path = "winit" }
iced_glutin = { version = "0.2", path = "glutin", optional = true }

View file

@ -15,8 +15,8 @@ debug = ["iced_winit/debug"]
[dependencies.glutin]
version = "0.27"
# git = "https://github.com/iced-rs/glutin"
# rev = "2564d0ab87cf2ad824a2a58733aebe40dd2f29bb"
git = "https://github.com/iced-rs/glutin"
rev = "03437d8a1826d83c62017b2bb7bf18bfc9e352cc"
[dependencies.iced_native]
version = "0.4"

View file

@ -20,8 +20,8 @@ thiserror = "1.0"
[dependencies.winit]
version = "0.25"
# git = "https://github.com/iced-rs/winit"
# rev = "e351421a32bf01b428325dde44dea39ee2656153"
git = "https://github.com/iced-rs/winit"
rev = "844485272a7412cb35cdbfac3524decdf59475ca"
[dependencies.iced_native]
version = "0.4"

View file

@ -218,17 +218,15 @@ pub fn menu<Message>(menu: &Menu<Message>) -> winit::window::Menu {
/// Given a [`Menu`] and an identifier of a [`menu::Entry`], it returns the
/// `Message` that should be produced when that entry is activated.
pub fn menu_message<Message>(menu: &Menu<Message>, id: isize) -> Option<Message>
pub fn menu_message<Message>(menu: &Menu<Message>, id: u32) -> Option<Message>
where
Message: Clone,
{
use std::convert::TryFrom;
fn find_message<Message>(
target: usize,
starting_id: usize,
target: u32,
starting_id: u32,
menu: &Menu<Message>,
) -> Result<Message, usize>
) -> Result<Message, u32>
where
Message: Clone,
{
@ -260,12 +258,7 @@ where
Err(id - starting_id)
}
// TODO: Does `winit` really need to provide an `isize`?
if let Ok(id) = usize::try_from(id) {
find_message(id, 0, menu).ok()
} else {
None
}
find_message(id, 0, menu).ok()
}
/// Converts a `MouseCursor` from [`iced_native`] to a [`winit`] cursor icon.