Update raw-window-handle to 0.2 (#1191)

This commit is contained in:
msiglreith 2019-09-30 17:17:01 +02:00 committed by Ryan G
parent 34348435fd
commit 18a0119b06
4 changed files with 16 additions and 6 deletions

View file

@ -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 {}