Cocoa: Finish launching NSApp in glfwInit

This moves the remaining bits of NSApplication initialization into
_glfwPlatformInit.  As a side-effect of this, any command-line program
initializing GLFW will get a menu bar, which is not ideal.

If this has happened to you and a bisect led you here, please see the
GLFW_COCOA_MENUBAR init hint introduced in GLFW 3.3.

If this patch is a terrible idea, please get in touch in the 3.4 release
timeframe.

This is a replacement for 6e6805000a,
which attempts to preserve the existing menu bar creation behavior for
the 3.3-stable branch.

Fixes #1649.
This commit is contained in:
Camilla Löwy
2020-03-05 20:32:19 +01:00
parent 6aca3e99f0
commit 72366ac9a9
9 changed files with 32 additions and 34 deletions

View File

@@ -241,6 +241,8 @@ int main(int argc, char** argv)
glfwSetErrorCallback(error_callback);
glfwInitHint(GLFW_COCOA_MENUBAR, GLFW_FALSE);
if (!glfwInit())
exit(EXIT_FAILURE);