|
@@ -891,10 +891,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
|
|
@autoreleasepool {
|
|
|
|
|
|
if (!_glfw.ns.finishedLaunching)
|
|
|
- {
|
|
|
[NSApp run];
|
|
|
- _glfw.ns.finishedLaunching = GLFW_TRUE;
|
|
|
- }
|
|
|
|
|
|
if (!createNativeWindow(window, wndconfig, fbconfig))
|
|
|
return GLFW_FALSE;
|
|
@@ -1385,6 +1382,9 @@ void _glfwPlatformPollEvents(void)
|
|
|
{
|
|
|
@autoreleasepool {
|
|
|
|
|
|
+ if (!_glfw.ns.finishedLaunching)
|
|
|
+ [NSApp run];
|
|
|
+
|
|
|
for (;;)
|
|
|
{
|
|
|
NSEvent* event = [NSApp nextEventMatchingMask:NSEventMaskAny
|
|
@@ -1404,6 +1404,9 @@ void _glfwPlatformWaitEvents(void)
|
|
|
{
|
|
|
@autoreleasepool {
|
|
|
|
|
|
+ if (!_glfw.ns.finishedLaunching)
|
|
|
+ [NSApp run];
|
|
|
+
|
|
|
// I wanted to pass NO to dequeue:, and rely on PollEvents to
|
|
|
// dequeue and send. For reasons not at all clear to me, passing
|
|
|
// NO to dequeue: causes this method never to return.
|
|
@@ -1422,6 +1425,9 @@ void _glfwPlatformWaitEventsTimeout(double timeout)
|
|
|
{
|
|
|
@autoreleasepool {
|
|
|
|
|
|
+ if (!_glfw.ns.finishedLaunching)
|
|
|
+ [NSApp run];
|
|
|
+
|
|
|
NSDate* date = [NSDate dateWithTimeIntervalSinceNow:timeout];
|
|
|
NSEvent* event = [NSApp nextEventMatchingMask:NSEventMaskAny
|
|
|
untilDate:date
|
|
@@ -1439,6 +1445,9 @@ void _glfwPlatformPostEmptyEvent(void)
|
|
|
{
|
|
|
@autoreleasepool {
|
|
|
|
|
|
+ if (!_glfw.ns.finishedLaunching)
|
|
|
+ [NSApp run];
|
|
|
+
|
|
|
NSEvent* event = [NSEvent otherEventWithType:NSEventTypeApplicationDefined
|
|
|
location:NSMakePoint(0, 0)
|
|
|
modifierFlags:0
|