This commit is contained in:
Kovid Goyal
2025-05-13 08:00:35 +05:30
parent 20d6a8e4c5
commit 8e12cccf26

View File

@@ -2227,7 +2227,7 @@ void _glfwPlatformHideWindow(_GLFWwindow* window)
if (_glfwPlatformWindowVisible(w)) num_visible++; if (_glfwPlatformWindowVisible(w)) num_visible++;
} }
if (!num_visible) { if (!num_visible) {
// yieldActivationToApplication was introduced in macOS 14 // yieldActivationToApplication was introduced in macOS 14 (Sonoma)
SEL selector = NSSelectorFromString(@"yieldActivationToApplication:"); SEL selector = NSSelectorFromString(@"yieldActivationToApplication:");
if ([NSApp respondsToSelector:selector]) { if ([NSApp respondsToSelector:selector]) {
[NSApp performSelector:selector withObject:app]; [NSApp performSelector:selector withObject:app];
@@ -2235,6 +2235,7 @@ void _glfwPlatformHideWindow(_GLFWwindow* window)
} else { } else {
#define NSApplicationActivateIgnoringOtherApps 2 #define NSApplicationActivateIgnoringOtherApps 2
[app activateWithOptions:NSApplicationActivateIgnoringOtherApps]; [app activateWithOptions:NSApplicationActivateIgnoringOtherApps];
#undef NSApplicationActivateIgnoringOtherApps
} }
} }
} }