Cocoa: Fix pre-window-creation event processing

Polling the event queue before NSApp had been allowed to finish
launching, in our case by starting our self-terminating run loop,
triggered an assertion inside NSApplication.

This fix, which makes all event processing functions capable of starting
it, makes that assertion less likely.

A more Cocoa-friendly fix would be to finish launching NSApp during
glfwInit and let people annoyed by the menu bar disabled it with
GLFW_COCOA_MENUBAR.  That may not be suitable for 3.3-stable, though.

Fixes #1543.

(cherry picked from commit 6e6805000a)
This commit is contained in:
Camilla Löwy
2019-11-27 23:21:13 +01:00
parent 17d727cd35
commit 2da4adce40
3 changed files with 15 additions and 5 deletions
+2 -2
View File
@@ -447,9 +447,9 @@ static GLFWbool initializeTIS(void)
- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
[NSApp stop:nil];
_glfw.ns.finishedLaunching = GLFW_TRUE;
_glfwPlatformPostEmptyEvent();
[NSApp stop:nil];
}
- (void)applicationDidHide:(NSNotification *)notification