From edc828065646b8877c444cb46e1e691fc46eabd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Thu, 10 Oct 2019 05:13:24 +0200 Subject: [PATCH] Revert "Update raw-window-handle to 0.2 (#1191)" This reverts commit 18a0119b06e5922d4a4759b5167b413fdd29179f. --- Cargo.toml | 2 +- src/platform_impl/android/mod.rs | 10 ---------- src/platform_impl/linux/mod.rs | 2 +- src/platform_impl/linux/x11/window.rs | 8 ++++---- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5720ae7b68a..267f39523ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ lazy_static = "1" libc = "0.2" log = "0.4" serde = { version = "1", optional = true, features = ["serde_derive"] } -raw-window-handle = "0.2" +raw-window-handle = "0.1" [dev-dependencies] image = "0.21" diff --git a/src/platform_impl/android/mod.rs b/src/platform_impl/android/mod.rs index 2c05e4bbe75..f88251ea86b 100644 --- a/src/platform_impl/android/mod.rs +++ b/src/platform_impl/android/mod.rs @@ -19,7 +19,6 @@ 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; @@ -422,15 +421,6 @@ 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/linux/mod.rs b/src/platform_impl/linux/mod.rs index 7b71de280fa..60430a2c402 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::Xlib(window.raw_window_handle()), + &Window::X(ref window) => RawWindowHandle::X11(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 305414f10e4..cf7759ecd38 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::XlibHandle; +use raw_window_handle::unix::X11Handle; use std::{ cmp, collections::HashSet, @@ -1296,11 +1296,11 @@ impl UnownedWindow { } #[inline] - pub fn raw_window_handle(&self) -> XlibHandle { - XlibHandle { + pub fn raw_window_handle(&self) -> X11Handle { + X11Handle { window: self.xwindow, display: self.xconn.display as _, - ..XlibHandle::empty() + ..X11Handle::empty() } } }