mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-05 23:51:29 +02:00
Fix building on older Cocoa
This commit is contained in:
@@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user