Use crates.io release of winit 🎉

This commit is contained in:
Héctor Ramón Jiménez 2025-12-05 22:40:58 +01:00
parent b11ad9ff5e
commit 8d7aac96d7
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
9 changed files with 11 additions and 143 deletions

View file

@ -37,8 +37,7 @@ where
event: Event::Window(window::Event::RedrawRequested(_)),
..
}
| subscription::Event::SystemThemeChanged(_)
| subscription::Event::PlatformSpecific(_) => None,
| subscription::Event::SystemThemeChanged(_) => None,
subscription::Event::Interaction {
window,
event,
@ -67,27 +66,6 @@ where
event,
status,
} => f(event, status, window),
subscription::Event::SystemThemeChanged(_)
| subscription::Event::PlatformSpecific(_) => None,
})
}
/// Creates a [`Subscription`] that notifies of custom application URL
/// received from the system.
///
/// _**Note:** Currently, it only triggers on macOS and the executable needs to be properly [bundled]!_
///
/// [bundled]: https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW19
pub fn listen_url() -> Subscription<String> {
#[derive(Hash)]
struct ListenUrl;
subscription::filter_map(ListenUrl, move |event| match event {
subscription::Event::PlatformSpecific(
subscription::PlatformSpecific::MacOS(
subscription::MacOS::ReceivedUrl(url),
),
) => Some(url),
_ => None,
subscription::Event::SystemThemeChanged(_) => None,
})
}

View file

@ -30,27 +30,6 @@ pub enum Event {
/// The system theme has changed.
SystemThemeChanged(theme::Mode),
/// A platform specific event.
PlatformSpecific(PlatformSpecific),
}
/// A platform specific event
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum PlatformSpecific {
/// A MacOS specific event
MacOS(MacOS),
}
/// Describes an event specific to MacOS
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum MacOS {
/// Triggered when the app receives an URL from the system
///
/// _**Note:** For this event to be triggered, the executable needs to be properly [bundled]!_
///
/// [bundled]: https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW19
ReceivedUrl(String),
}
/// A stream of runtime events.