Implement raw_window_handle::HasRawWindowHandle for Window type (#1105)
* Implement raw_window_handle::HasRawWindowHandle for Window type * Format * Address compilation issues * Fix Linux build hopefully * Fix iOS build
This commit is contained in:
parent
1aab328e2a
commit
604016d69d
9 changed files with 67 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#![cfg(target_os = "windows")]
|
||||
|
||||
use parking_lot::Mutex;
|
||||
use raw_window_handle::{windows::WindowsHandle, RawWindowHandle};
|
||||
use std::{
|
||||
cell::Cell,
|
||||
ffi::OsStr,
|
||||
|
|
@ -339,6 +340,15 @@ impl Window {
|
|||
self.window.0
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn raw_window_handle(&self) -> RawWindowHandle {
|
||||
let handle = WindowsHandle {
|
||||
hwnd: self.window.0 as *mut _,
|
||||
..WindowsHandle::empty()
|
||||
};
|
||||
RawWindowHandle::Windows(handle)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn set_cursor_icon(&self, cursor: CursorIcon) {
|
||||
self.window_state.lock().mouse.cursor = cursor;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue