Fix building on older Cocoa
This commit is contained in:
parent
a47babc87d
commit
20d6a8e4c5
1 changed files with 9 additions and 2 deletions
|
|
@ -2227,8 +2227,15 @@ void _glfwPlatformHideWindow(_GLFWwindow* window)
|
|||
if (_glfwPlatformWindowVisible(w)) num_visible++;
|
||||
}
|
||||
if (!num_visible) {
|
||||
[NSApp yieldActivationToApplication: app];
|
||||
[app activateWithOptions:0];
|
||||
// yieldActivationToApplication was introduced in macOS 14
|
||||
SEL selector = NSSelectorFromString(@"yieldActivationToApplication:");
|
||||
if ([NSApp respondsToSelector:selector]) {
|
||||
[NSApp performSelector:selector withObject:app];
|
||||
[app activateWithOptions:0];
|
||||
} else {
|
||||
#define NSApplicationActivateIgnoringOtherApps 2
|
||||
[app activateWithOptions:NSApplicationActivateIgnoringOtherApps];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue