mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-28 07:33:14 -04:00
Add raw-window-handle support to Winit 0.19 and bump version (#1225)
* Add raw-window-handle support to Winit 0.19 and bump version * Hopefully fix linux and ios builds
This commit is contained in:
@@ -35,6 +35,8 @@ use platform::platform::raw_input::register_all_mice_and_keyboards_for_raw_input
|
||||
use platform::platform::util;
|
||||
use platform::platform::window_state::{CursorFlags, SavedWindow, WindowFlags, WindowState};
|
||||
|
||||
use raw_window_handle::{windows::WindowsHandle, RawWindowHandle};
|
||||
|
||||
/// The Win32 implementation of the main `Window` object.
|
||||
pub struct Window {
|
||||
/// Main handle for the window.
|
||||
@@ -268,6 +270,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(&self, cursor: MouseCursor) {
|
||||
self.window_state.lock().unwrap().mouse.cursor = cursor;
|
||||
|
||||
Reference in New Issue
Block a user