mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 07:03:15 -04:00
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:
@@ -1,3 +1,4 @@
|
||||
use raw_window_handle::{macos::MacOSHandle, RawWindowHandle};
|
||||
use std::{
|
||||
collections::VecDeque,
|
||||
f64,
|
||||
@@ -904,6 +905,16 @@ impl UnownedWindow {
|
||||
pub fn primary_monitor(&self) -> MonitorHandle {
|
||||
monitor::primary_monitor()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn raw_window_handle(&self) -> RawWindowHandle {
|
||||
let handle = MacOSHandle {
|
||||
ns_window: *self.ns_window as *mut _,
|
||||
ns_view: *self.ns_view as *mut _,
|
||||
..MacOSHandle::empty()
|
||||
};
|
||||
RawWindowHandle::MacOS(handle)
|
||||
}
|
||||
}
|
||||
|
||||
impl WindowExtMacOS for UnownedWindow {
|
||||
|
||||
Reference in New Issue
Block a user