The NSScreen safeAreaInsets property is macOS 12. Older SDKs do not declare it, so the message returns id and qemu 11.1.0 fails with an incompatible initialisation of NSEdgeInsets. Screens without a notch report zero insets, so substituting zeros preserves behaviour. The guard tests MAC_OS_X_VERSION_MIN_REQUIRED, not MAX_ALLOWED: this is a runtime message send, so building against a macOS 12 SDK while targeting an older system must still take the fallback. Note that +cocoa is a default variant only at darwin >= 18, so this is reached on 10.14 and 10.15 but not below. See https://trac.macports.org/ticket/70482 --- ui/cocoa.m.orig +++ ui/cocoa.m @@ -489,7 +489,14 @@ - (NSSize) screenSafeAreaSize { NSSize size = [[[self window] screen] frame].size; + /* -[NSScreen safeAreaInsets] is macOS 12+; older SDKs do not declare it. + * Screens without a notch have zero insets, so this is a no-op there. */ +#if defined(MAC_OS_VERSION_12_0) && \ + MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_VERSION_12_0 NSEdgeInsets insets = [[[self window] screen] safeAreaInsets]; +#else + NSEdgeInsets insets = NSEdgeInsetsMake(0, 0, 0, 0); +#endif size.width -= insets.left + insets.right; size.height -= insets.top + insets.bottom; return size;