From 6b72a60d8cdc2c6bc13c50d093ba85125afc9bda Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Tue, 2 Jun 2026 14:25:06 +1000 Subject: [PATCH] WgpuMetalSurface_mac: switch to umbrella The narrow `` header only forward-declares NSWindow, so `view.window.backingScaleFactor` fails to compile on macOS with: error: property 'backingScaleFactor' cannot be found in forward class object 'NSWindow' Use the AppKit umbrella header so NSWindow's interface (including backingScaleFactor) is in scope. Same idiomatic include any non-trivial Cocoa code reaches for; we're already linking -framework Cocoa so there's no compile-time cost beyond a slightly heavier translation unit (the .mm is ~30 lines anyway). Co-Authored-By: Claude Opus 4.7 --- src/ifcviewer-wgpu/WgpuMetalSurface_mac.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ifcviewer-wgpu/WgpuMetalSurface_mac.mm b/src/ifcviewer-wgpu/WgpuMetalSurface_mac.mm index 5aa7cd03ea..d4ac05fc77 100644 --- a/src/ifcviewer-wgpu/WgpuMetalSurface_mac.mm +++ b/src/ifcviewer-wgpu/WgpuMetalSurface_mac.mm @@ -7,7 +7,10 @@ #if defined(__APPLE__) -#import +// The AppKit umbrella header pulls in NSWindow so `view.window`'s +// `backingScaleFactor` resolves — `` alone only +// forward-declares NSWindow. +#import #import void* wgpu_macos_attach_metal_layer(void* nsview_ptr) {