From 4b1aa51094edf3ee02b7f7dd111c739fdc0d4016 Mon Sep 17 00:00:00 2001 From: daxpedda Date: Mon, 22 Jul 2024 12:11:27 +0200 Subject: [PATCH] macOS: fix building with `feature = "rwh_04"` --- src/changelog/unreleased.md | 4 ++++ src/platform_impl/macos/window_delegate.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/changelog/unreleased.md b/src/changelog/unreleased.md index 3ed337ce4..051f12aff 100644 --- a/src/changelog/unreleased.md +++ b/src/changelog/unreleased.md @@ -43,3 +43,7 @@ changelog entry. ### Added - On Web, implement `Error` for `platform::web::CustomCursorError`. + +### Fixed + +- On MacOS, fix building with `feature = "rwh_04"`. diff --git a/src/platform_impl/macos/window_delegate.rs b/src/platform_impl/macos/window_delegate.rs index 674088cf0..6f3d4abb5 100644 --- a/src/platform_impl/macos/window_delegate.rs +++ b/src/platform_impl/macos/window_delegate.rs @@ -1613,7 +1613,7 @@ impl WindowDelegate { pub fn raw_window_handle_rwh_04(&self) -> rwh_04::RawWindowHandle { let mut window_handle = rwh_04::AppKitHandle::empty(); window_handle.ns_window = self.window() as *const WinitWindow as *mut _; - window_handle.ns_view = Retained::as_ptr(&self.contentView().unwrap()) as *mut _; + window_handle.ns_view = Retained::as_ptr(&self.view()) as *mut _; rwh_04::RawWindowHandle::AppKit(window_handle) }