Skip to content

Commit f67e6ec

Browse files
committed
Use crates.io release for winit
1 parent f897442 commit f67e6ec

File tree

9 files changed

+6
-133
lines changed

9 files changed

+6
-133
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ web-time = "1.1"
182182
wgpu = "0.19"
183183
winapi = "0.3"
184184
window_clipboard = "0.4.1"
185-
winit = { git = "https://github.com/iced-rs/winit.git", rev = "254d6b3420ce4e674f516f7a2bd440665e05484d" }
185+
winit = "0.30"
186186

187187
[workspace.lints.rust]
188188
rust_2018_idioms = { level = "forbid", priority = -1 }

examples/url_handler/Cargo.toml

-9
This file was deleted.

examples/url_handler/src/main.rs

-42
This file was deleted.

futures/src/event.rs

+1-23
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ where
3636
subscription::Event::Interaction {
3737
event: Event::Window(window::Event::RedrawRequested(_)),
3838
..
39-
}
40-
| subscription::Event::PlatformSpecific(_) => None,
39+
} => None,
4140
subscription::Event::Interaction {
4241
window,
4342
event,
@@ -66,26 +65,5 @@ where
6665
event,
6766
status,
6867
} => f(event, status, window),
69-
subscription::Event::PlatformSpecific(_) => None,
70-
})
71-
}
72-
73-
/// Creates a [`Subscription`] that notifies of custom application URL
74-
/// received from the system.
75-
///
76-
/// _**Note:** Currently, it only triggers on macOS and the executable needs to be properly [bundled]!_
77-
///
78-
/// [bundled]: https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW19
79-
pub fn listen_url() -> Subscription<String> {
80-
#[derive(Hash)]
81-
struct ListenUrl;
82-
83-
subscription::filter_map(ListenUrl, move |event| match event {
84-
subscription::Event::PlatformSpecific(
85-
subscription::PlatformSpecific::MacOS(
86-
subscription::MacOS::ReceivedUrl(url),
87-
),
88-
) => Some(url),
89-
_ => None,
9068
})
9169
}

futures/src/keyboard.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ where
2626
status: event::Status::Ignored,
2727
..
2828
} => f(key, modifiers),
29-
_ => None,
29+
subscription::Event::Interaction { .. } => None,
3030
})
3131
}
3232

@@ -51,6 +51,6 @@ where
5151
status: event::Status::Ignored,
5252
..
5353
} => f(key, modifiers),
54-
_ => None,
54+
subscription::Event::Interaction { .. } => None,
5555
})
5656
}

futures/src/subscription.rs

-21
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,6 @@ pub enum Event {
2626
/// The [`event::Status`] of the interaction.
2727
status: event::Status,
2828
},
29-
30-
/// A platform specific event.
31-
PlatformSpecific(PlatformSpecific),
32-
}
33-
34-
/// A platform specific event
35-
#[derive(Debug, Clone, PartialEq, Eq)]
36-
pub enum PlatformSpecific {
37-
/// A MacOS specific event
38-
MacOS(MacOS),
39-
}
40-
41-
/// Describes an event specific to MacOS
42-
#[derive(Debug, Clone, PartialEq, Eq)]
43-
pub enum MacOS {
44-
/// Triggered when the app receives an URL from the system
45-
///
46-
/// _**Note:** For this event to be triggered, the executable needs to be properly [bundled]!_
47-
///
48-
/// [bundled]: https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW19
49-
ReceivedUrl(String),
5029
}
5130

5231
/// A stream of runtime events.

src/advanced.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
pub mod subscription {
33
//! Write your own subscriptions.
44
pub use crate::runtime::futures::subscription::{
5-
from_recipe, into_recipes, Event, EventStream, Hasher, MacOS,
6-
PlatformSpecific, Recipe,
5+
from_recipe, into_recipes, Event, EventStream, Hasher, Recipe,
76
};
87
}
98

src/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,7 @@ pub mod font {
530530
pub mod event {
531531
//! Handle events of a user interface.
532532
pub use crate::core::event::{Event, Status};
533-
pub use iced_futures::event::{
534-
listen, listen_raw, listen_url, listen_with,
535-
};
533+
pub use iced_futures::event::{listen, listen_raw, listen_with};
536534
}
537535

538536
pub mod keyboard {

winit/src/program.rs

-30
Original file line numberDiff line numberDiff line change
@@ -431,23 +431,6 @@ where
431431
);
432432
}
433433

434-
fn received_url(
435-
&mut self,
436-
event_loop: &winit::event_loop::ActiveEventLoop,
437-
url: String,
438-
) {
439-
self.process_event(
440-
event_loop,
441-
Event::EventLoopAwakened(
442-
winit::event::Event::PlatformSpecific(
443-
winit::event::PlatformSpecific::MacOS(
444-
winit::event::MacOS::ReceivedUrl(url),
445-
),
446-
),
447-
),
448-
);
449-
}
450-
451434
fn about_to_wait(
452435
&mut self,
453436
event_loop: &winit::event_loop::ActiveEventLoop,
@@ -766,19 +749,6 @@ async fn run_instance<P, C>(
766749
window.raw.request_redraw();
767750
}
768751
}
769-
event::Event::PlatformSpecific(
770-
event::PlatformSpecific::MacOS(
771-
event::MacOS::ReceivedUrl(url),
772-
),
773-
) => {
774-
runtime.broadcast(
775-
subscription::Event::PlatformSpecific(
776-
subscription::PlatformSpecific::MacOS(
777-
subscription::MacOS::ReceivedUrl(url),
778-
),
779-
),
780-
);
781-
}
782752
event::Event::UserEvent(action) => {
783753
run_action(
784754
action,

0 commit comments

Comments
 (0)