From 5ee6c4526d81e8047d5067218c992331f3c79467 Mon Sep 17 00:00:00 2001 From: ws909 <37029098+ws909@users.noreply.github.com> Date: Thu, 26 Jan 2023 02:30:27 +0100 Subject: [PATCH] Guard Cocoa system appearance observation in ifdefs for MacOS 10.14+ NSAppearanceName constants have various OS constraints, and so require more thorough checks. --- src/cocoa_init.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cocoa_init.m b/src/cocoa_init.m index 46d9925b..059eb10f 100644 --- a/src/cocoa_init.m +++ b/src/cocoa_init.m @@ -448,6 +448,7 @@ static GLFWbool initializeTIS(void) _glfwInputSystemTheme(NULL); }*/ +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400 - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change @@ -472,6 +473,7 @@ static GLFWbool initializeTIS(void) [self accentColorChanged]; }*/ } +#endif @end // GLFWHelper @@ -734,10 +736,12 @@ int _glfwInitCocoa(void) context:nil]; */ +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400 [NSApp addObserver:_glfw.ns.helper forKeyPath:@"effectiveAppearance" options:0 context:nil]; +#endif if (![[NSRunningApplication currentApplication] isFinishedLaunching]) [NSApp run];