mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-26 15:21:29 +11:00
c71b14afb9
Also implements platform_window() for cocoa.
20 lines
513 B
Rust
20 lines
513 B
Rust
#![cfg(target_os = "macos")]
|
|
|
|
use std::os::raw::c_void;
|
|
use Window;
|
|
|
|
/// Additional methods on `Window` that are specific to MacOS.
|
|
pub trait WindowExt {
|
|
/// Returns a pointer to the cocoa `NSWindow` that is used by this window.
|
|
///
|
|
/// The pointer will become invalid when the glutin `Window` is destroyed.
|
|
fn get_nswindow(&self) -> *mut c_void;
|
|
}
|
|
|
|
impl WindowExt for Window {
|
|
#[inline]
|
|
fn get_nswindow(&self) -> *mut c_void {
|
|
self.window.platform_window() as *mut c_void
|
|
}
|
|
}
|