Cocoa: Fix menubar for unbundled apps on 10.15

NSApp setActivationPolicy: was being called too soon when the app was
not bundled and launched from the command line.

This fix is based on #1802 by @richardwilkes.

Fixes #1648.
Closes #1802.
This commit is contained in:
Camilla Löwy
2020-12-08 23:23:20 +01:00
parent 552209fe46
commit 8b11867464
2 changed files with 6 additions and 3 deletions
+3 -3
View File
@@ -428,9 +428,6 @@ static GLFWbool initializeTIS(void)
{
if (_glfw.hints.init.ns.menubar)
{
// In case we are unbundled, make us a proper UI application
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
// Menu bar setup must go between sharedApplication and finishLaunching
// in order to properly emulate the behavior of NSApplicationMain
@@ -557,6 +554,9 @@ int _glfwPlatformInit(void)
if (![[NSRunningApplication currentApplication] isFinishedLaunching])
[NSApp run];
// In case we are unbundled, make us a proper UI application
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
return GLFW_TRUE;
} // autoreleasepool