diff --git a/Cargo.toml b/Cargo.toml index d21b59fe..ddffed0c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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.2.0" +raw-window-handle = "0.2" [dev-dependencies] image = "0.21" diff --git a/src/platform_impl/android/mod.rs b/src/platform_impl/android/mod.rs index f88251ea..2c05e4bb 100644 --- a/src/platform_impl/android/mod.rs +++ b/src/platform_impl/android/mod.rs @@ -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 {} diff --git a/src/platform_impl/ios/view.rs b/src/platform_impl/ios/view.rs index 5868059b..6f712dd3 100644 --- a/src/platform_impl/ios/view.rs +++ b/src/platform_impl/ios/view.rs @@ -500,9 +500,7 @@ pub unsafe fn create_window( let () = msg_send![uiscreen, setCurrentMode: video_mode.video_mode.screen_mode]; msg_send![window, setScreen:video_mode.monitor().ui_screen()] } - Some(Fullscreen::Borderless(ref monitor)) => { - msg_send![window, setScreen:monitor.ui_screen()] - } + Some(Fullscreen::Borderless(ref monitor)) => msg_send![window, setScreen:monitor.ui_screen()], None => (), } diff --git a/src/platform_impl/linux/mod.rs b/src/platform_impl/linux/mod.rs index 60430a2c..7b71de28 100644 --- a/src/platform_impl/linux/mod.rs +++ b/src/platform_impl/linux/mod.rs @@ -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()), } } diff --git a/src/platform_impl/linux/x11/window.rs b/src/platform_impl/linux/x11/window.rs index cf7759ec..305414f1 100644 --- a/src/platform_impl/linux/x11/window.rs +++ b/src/platform_impl/linux/x11/window.rs @@ -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() } } }