From 2042be05feeaa7030425f4d4853853beaa21a9af Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Tue, 14 Jul 2026 14:45:39 +0000 Subject: [PATCH 3/5] Cocoa: Guard -setRestorable: for the 10.6 SDK -setRestorable: was added in Mac OS X 10.7; on 10.6 the running NSWindow does not implement it at all, so calling it unconditionally throws NSInvalidArgumentException ("unrecognized selector") at launch and crashes every app linked against this build. The 10.6 GCC build compiled clean because the untyped id fallback silenced the missing declaration, masking the runtime crash until an app actually ran on real 10.6 hardware. Guard with -respondsToSelector:, matching the existing pattern used for -setTabbingMode: two lines below. --- src/cocoa_window.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 7fe5618f..05cff7b2 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -948,7 +948,12 @@ static GLFWbool createNativeWindow(_GLFWwindow* window, [window->ns.object setTitle:[NSString stringWithUTF8String:window->title]]; [window->ns.object setDelegate:window->ns.delegate]; [window->ns.object setAcceptsMouseMovedEvents:YES]; - [window->ns.object setRestorable:NO]; + + // NOTE: -setRestorable: was added in the 10.7 SDK and macOS 10.7; on + // 10.6 GLFWWindow does not respond to it at all, so an + // unconditional call throws NSInvalidArgumentException at runtime + if ([window->ns.object respondsToSelector:@selector(setRestorable:)]) + [window->ns.object setRestorable:NO]; #if MAC_OS_X_VERSION_MAX_ALLOWED >= 101200 if ([window->ns.object respondsToSelector:@selector(setTabbingMode:)]) -- 2.43.0