mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-23 22:01:31 +11:00
Update raw-window-handle to 0.2 (#1191)
This commit is contained in:
parent
34348435fd
commit
18a0119b06
|
@ -20,7 +20,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 = "0.2"
|
||||
|
||||
[dev-dependencies]
|
||||
image = "0.21"
|
||||
|
|
|
@ -19,6 +19,7 @@ use crate::{
|
|||
CreationError, CursorIcon, Event, LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize,
|
||||
WindowAttributes, WindowEvent, WindowId as RootWindowId,
|
||||
};
|
||||
use raw_window_handle::{android::AndroidHandle, RawWindowHandle};
|
||||
use CreationError::OsError;
|
||||
|
||||
pub type OsError = std::io::Error;
|
||||
|
@ -421,6 +422,15 @@ impl Window {
|
|||
pub fn id(&self) -> WindowId {
|
||||
WindowId
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn raw_window_handle(&self) -> RawWindowHandle {
|
||||
let handle = AndroidHandle {
|
||||
a_native_window: self.native_window,
|
||||
..WindowsHandle::empty()
|
||||
};
|
||||
RawWindowHandle::Android(handle)
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for Window {}
|
||||
|
|
|
@ -461,7 +461,7 @@ impl Window {
|
|||
|
||||
pub fn raw_window_handle(&self) -> RawWindowHandle {
|
||||
match self {
|
||||
&Window::X(ref window) => RawWindowHandle::X11(window.raw_window_handle()),
|
||||
&Window::X(ref window) => RawWindowHandle::Xlib(window.raw_window_handle()),
|
||||
&Window::Wayland(ref window) => RawWindowHandle::Wayland(window.raw_window_handle()),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use raw_window_handle::unix::X11Handle;
|
||||
use raw_window_handle::unix::XlibHandle;
|
||||
use std::{
|
||||
cmp,
|
||||
collections::HashSet,
|
||||
|
@ -1296,11 +1296,11 @@ impl UnownedWindow {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn raw_window_handle(&self) -> X11Handle {
|
||||
X11Handle {
|
||||
pub fn raw_window_handle(&self) -> XlibHandle {
|
||||
XlibHandle {
|
||||
window: self.xwindow,
|
||||
display: self.xconn.display as _,
|
||||
..X11Handle::empty()
|
||||
..XlibHandle::empty()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue