mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 05:10:03 -04:00
Partially replace custom AppKit bindings with icrate's autogenerated bindings (#2982)
* Refactor winit-specific cursor logic out of appkit module * Add relevant AppKit features that we depend on * Use icrate's NSImageRep and NSBitmapImageRep * Use icrate's NSImage * Use icrate's NSCursor * Use icrate's NSAppearance * Use icrate's NSScreen * Use icrate's NSButton * Use icrate's NSAppKitVersionNumber * Use icrate's NSTextInputContext * Use icrate's NSColor * Use icrate's NSEvent * Use icrate's NSMenu and NSMenuItem * Use icrate's NSPasteboard * Use icrate's NSResponder * Use icrate's NSTextInputClient * Use icrate's NSView
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use std::os::raw::c_void;
|
||||
|
||||
use icrate::Foundation::MainThreadMarker;
|
||||
use objc2::rc::Id;
|
||||
|
||||
use crate::{
|
||||
@@ -365,7 +366,9 @@ impl MonitorHandleExtMacOS for MonitorHandle {
|
||||
}
|
||||
|
||||
fn ns_screen(&self) -> Option<*mut c_void> {
|
||||
self.inner.ns_screen().map(|s| Id::as_ptr(&s) as _)
|
||||
// SAFETY: We only use the marker to get a pointer
|
||||
let mtm = unsafe { MainThreadMarker::new_unchecked() };
|
||||
self.inner.ns_screen(mtm).map(|s| Id::as_ptr(&s) as _)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user