mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-23 22:01:31 +11:00
Fix compilation errors
This commit is contained in:
parent
3e8669ea7f
commit
6732fa731d
|
@ -25,7 +25,7 @@ libc = "0.2"
|
|||
log = "0.4"
|
||||
serde = { version = "1", optional = true, features = ["serde_derive"] }
|
||||
derivative = "1.0.2"
|
||||
raw-window-handle = "0.1"
|
||||
raw-window-handle = { git = "https://github.com/ryanisaacg/raw-window-handle", branch = "add-web-support" }
|
||||
|
||||
[dev-dependencies]
|
||||
image = "0.21"
|
||||
|
|
|
@ -2,8 +2,7 @@ use super::runner;
|
|||
use crate::event::Event;
|
||||
use crate::event_loop::EventLoopClosed;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Proxy<T: 'static> {
|
||||
pub struct Proxy<T: 'static>{
|
||||
runner: runner::Shared<T>,
|
||||
}
|
||||
|
||||
|
@ -17,3 +16,11 @@ impl<T: 'static> Proxy<T> {
|
|||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: 'static> Clone for Proxy<T> {
|
||||
fn clone(&self) -> Self {
|
||||
Proxy {
|
||||
runner: self.runner.clone()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,9 @@ pub use self::error::OsError;
|
|||
pub use self::event_loop::{
|
||||
EventLoop, Proxy as EventLoopProxy, WindowTarget as EventLoopWindowTarget,
|
||||
};
|
||||
pub use self::monitor::Handle as MonitorHandle;
|
||||
pub use self::monitor::{
|
||||
Handle as MonitorHandle, Mode as VideoMode
|
||||
};
|
||||
pub use self::window::{
|
||||
Id as WindowId, PlatformSpecificBuilderAttributes as PlatformSpecificWindowBuilderAttributes,
|
||||
Window,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use crate::dpi::{PhysicalPosition, PhysicalSize};
|
||||
use crate::monitor::VideoMode;
|
||||
use crate::monitor::{MonitorHandle, VideoMode};
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct Handle;
|
||||
|
@ -26,3 +26,28 @@ impl Handle {
|
|||
std::iter::empty()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Derivative)]
|
||||
#[derivative(Clone, Debug, PartialEq, Eq, Hash)]
|
||||
pub struct Mode;
|
||||
|
||||
impl Mode {
|
||||
pub fn size(&self) -> PhysicalSize {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
pub fn bit_depth(&self) -> u16 {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
pub fn refresh_rate(&self) -> u16 {
|
||||
32
|
||||
}
|
||||
|
||||
pub fn monitor(&self) -> MonitorHandle {
|
||||
MonitorHandle {
|
||||
inner: Handle
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@ use crate::dpi::{LogicalPosition, LogicalSize};
|
|||
use crate::error::{ExternalError, NotSupportedError, OsError as RootOE};
|
||||
use crate::icon::Icon;
|
||||
use crate::monitor::MonitorHandle as RootMH;
|
||||
use crate::window::{CursorIcon, WindowAttributes, WindowId as RootWI};
|
||||
use crate::window::{CursorIcon, Fullscreen, WindowAttributes, WindowId as RootWI};
|
||||
|
||||
use raw_window_handle::{RawWindowHandle, web::WebHandle};
|
||||
|
||||
use super::{backend, monitor, EventLoopWindowTarget};
|
||||
|
||||
|
@ -203,13 +205,13 @@ impl Window {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn fullscreen(&self) -> Option<RootMH> {
|
||||
pub fn fullscreen(&self) -> Option<Fullscreen> {
|
||||
// TODO: should there be a maximization / fullscreen API?
|
||||
None
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn set_fullscreen(&self, _monitor: Option<RootMH>) {
|
||||
pub fn set_fullscreen(&self, _monitor: Option<Fullscreen>) {
|
||||
// TODO: should there be a maximization / fullscreen API?
|
||||
}
|
||||
|
||||
|
@ -254,6 +256,16 @@ impl Window {
|
|||
pub fn id(&self) -> Id {
|
||||
return self.id;
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
|
||||
let handle = WebHandle {
|
||||
id: self.id.0,
|
||||
..WebHandle::empty()
|
||||
};
|
||||
|
||||
raw_window_handle::RawWindowHandle::Web(handle)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
|
|
Loading…
Reference in a new issue