mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-11 21:31:29 +11:00
Remove derivative dependency (#1201)
* Remove derivative dependency * Update CHANGELOG.md
This commit is contained in:
parent
5ced36e319
commit
4f6ca8792c
|
@ -21,7 +21,8 @@
|
||||||
- On X11, prevent stealing input focus when creating a new window.
|
- On X11, prevent stealing input focus when creating a new window.
|
||||||
Only steal input focus when entering fullscreen mode.
|
Only steal input focus when entering fullscreen mode.
|
||||||
- On Wayland, add support for set_cursor_visible and set_cursor_grab.
|
- On Wayland, add support for set_cursor_visible and set_cursor_grab.
|
||||||
- On Wayland, fixed DeviceEvents for relative mouse movement is not always produced
|
- On Wayland, fixed DeviceEvents for relative mouse movement is not always produced.
|
||||||
|
- Removed `derivative` crate dependency.
|
||||||
- On Wayland, add support for set_cursor_icon.
|
- On Wayland, add support for set_cursor_icon.
|
||||||
|
|
||||||
# 0.20.0 Alpha 3 (2019-08-14)
|
# 0.20.0 Alpha 3 (2019-08-14)
|
||||||
|
|
|
@ -19,7 +19,6 @@ lazy_static = "1"
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
serde = { version = "1", optional = true, features = ["serde_derive"] }
|
serde = { version = "1", optional = true, features = ["serde_derive"] }
|
||||||
derivative = "1.0.2"
|
|
||||||
raw-window-handle = "0.2"
|
raw-window-handle = "0.2"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
|
|
@ -121,8 +121,6 @@ extern crate log;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde;
|
extern crate serde;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate derivative;
|
|
||||||
#[macro_use]
|
|
||||||
#[cfg(any(target_os = "ios", target_os = "windows"))]
|
#[cfg(any(target_os = "ios", target_os = "windows"))]
|
||||||
extern crate bitflags;
|
extern crate bitflags;
|
||||||
#[cfg(any(target_os = "macos", target_os = "ios"))]
|
#[cfg(any(target_os = "macos", target_os = "ios"))]
|
||||||
|
|
|
@ -52,12 +52,17 @@ impl Iterator for AvailableMonitorsIter {
|
||||||
/// - [`MonitorHandle::video_modes`][monitor_get].
|
/// - [`MonitorHandle::video_modes`][monitor_get].
|
||||||
///
|
///
|
||||||
/// [monitor_get]: ../monitor/struct.MonitorHandle.html#method.video_modes
|
/// [monitor_get]: ../monitor/struct.MonitorHandle.html#method.video_modes
|
||||||
#[derive(Derivative)]
|
#[derive(Clone, PartialEq, Eq, Hash)]
|
||||||
#[derivative(Clone, Debug = "transparent", PartialEq, Eq, Hash)]
|
|
||||||
pub struct VideoMode {
|
pub struct VideoMode {
|
||||||
pub(crate) video_mode: platform_impl::VideoMode,
|
pub(crate) video_mode: platform_impl::VideoMode,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl std::fmt::Debug for VideoMode {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
self.video_mode.fmt(f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl PartialOrd for VideoMode {
|
impl PartialOrd for VideoMode {
|
||||||
fn partial_cmp(&self, other: &VideoMode) -> Option<std::cmp::Ordering> {
|
fn partial_cmp(&self, other: &VideoMode) -> Option<std::cmp::Ordering> {
|
||||||
Some(self.cmp(other))
|
Some(self.cmp(other))
|
||||||
|
|
|
@ -22,17 +22,46 @@ use core_video_sys::{
|
||||||
CVDisplayLinkGetNominalOutputVideoRefreshPeriod, CVDisplayLinkRelease,
|
CVDisplayLinkGetNominalOutputVideoRefreshPeriod, CVDisplayLinkRelease,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Derivative)]
|
#[derive(Clone)]
|
||||||
#[derivative(Debug, Clone, PartialEq, Hash)]
|
|
||||||
pub struct VideoMode {
|
pub struct VideoMode {
|
||||||
pub(crate) size: (u32, u32),
|
pub(crate) size: (u32, u32),
|
||||||
pub(crate) bit_depth: u16,
|
pub(crate) bit_depth: u16,
|
||||||
pub(crate) refresh_rate: u16,
|
pub(crate) refresh_rate: u16,
|
||||||
pub(crate) monitor: MonitorHandle,
|
pub(crate) monitor: MonitorHandle,
|
||||||
#[derivative(Debug = "ignore", PartialEq = "ignore", Hash = "ignore")]
|
|
||||||
pub(crate) native_mode: NativeDisplayMode,
|
pub(crate) native_mode: NativeDisplayMode,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl PartialEq for VideoMode {
|
||||||
|
fn eq(&self, other: &Self) -> bool {
|
||||||
|
self.size == other.size
|
||||||
|
&& self.bit_depth == other.bit_depth
|
||||||
|
&& self.refresh_rate == other.refresh_rate
|
||||||
|
&& self.monitor == other.monitor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Eq for VideoMode {}
|
||||||
|
|
||||||
|
impl std::hash::Hash for VideoMode {
|
||||||
|
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
|
||||||
|
self.size.hash(state);
|
||||||
|
self.bit_depth.hash(state);
|
||||||
|
self.refresh_rate.hash(state);
|
||||||
|
self.monitor.hash(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl std::fmt::Debug for VideoMode {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
f.debug_struct("VideoMode")
|
||||||
|
.field("size", &self.size)
|
||||||
|
.field("bit_depth", &self.bit_depth)
|
||||||
|
.field("refresh_rate", &self.refresh_rate)
|
||||||
|
.field("monitor", &self.monitor)
|
||||||
|
.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub struct NativeDisplayMode(pub ffi::CGDisplayModeRef);
|
pub struct NativeDisplayMode(pub ffi::CGDisplayModeRef);
|
||||||
|
|
||||||
unsafe impl Send for NativeDisplayMode {}
|
unsafe impl Send for NativeDisplayMode {}
|
||||||
|
|
|
@ -21,17 +21,46 @@ use crate::{
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Derivative)]
|
#[derive(Clone)]
|
||||||
#[derivative(Debug, Clone, Eq, PartialEq, Hash)]
|
|
||||||
pub struct VideoMode {
|
pub struct VideoMode {
|
||||||
pub(crate) size: (u32, u32),
|
pub(crate) size: (u32, u32),
|
||||||
pub(crate) bit_depth: u16,
|
pub(crate) bit_depth: u16,
|
||||||
pub(crate) refresh_rate: u16,
|
pub(crate) refresh_rate: u16,
|
||||||
pub(crate) monitor: MonitorHandle,
|
pub(crate) monitor: MonitorHandle,
|
||||||
#[derivative(Debug = "ignore", PartialEq = "ignore", Hash = "ignore")]
|
|
||||||
pub(crate) native_video_mode: wingdi::DEVMODEW,
|
pub(crate) native_video_mode: wingdi::DEVMODEW,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl PartialEq for VideoMode {
|
||||||
|
fn eq(&self, other: &Self) -> bool {
|
||||||
|
self.size == other.size
|
||||||
|
&& self.bit_depth == other.bit_depth
|
||||||
|
&& self.refresh_rate == other.refresh_rate
|
||||||
|
&& self.monitor == other.monitor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Eq for VideoMode {}
|
||||||
|
|
||||||
|
impl std::hash::Hash for VideoMode {
|
||||||
|
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
|
||||||
|
self.size.hash(state);
|
||||||
|
self.bit_depth.hash(state);
|
||||||
|
self.refresh_rate.hash(state);
|
||||||
|
self.monitor.hash(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl std::fmt::Debug for VideoMode {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
f.debug_struct("VideoMode")
|
||||||
|
.field("size", &self.size)
|
||||||
|
.field("bit_depth", &self.bit_depth)
|
||||||
|
.field("refresh_rate", &self.refresh_rate)
|
||||||
|
.field("monitor", &self.monitor)
|
||||||
|
.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl VideoMode {
|
impl VideoMode {
|
||||||
pub fn size(&self) -> PhysicalSize {
|
pub fn size(&self) -> PhysicalSize {
|
||||||
self.size.into()
|
self.size.into()
|
||||||
|
|
Loading…
Reference in a new issue