From d0afa6581336be0b6b513d6995e8d7b2a7e97596 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Sun, 21 Oct 2012 16:17:20 +0200 Subject: [PATCH] Formatting. --- src/cocoa_window.m | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 034fcde1..a5fca40d 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -1084,19 +1084,17 @@ void _glfwPlatformRefreshWindowParams(_GLFWwindow* window) void _glfwPlatformPollEvents(void) { - NSEvent* event; - - do + for (;;) { - event = [NSApp nextEventMatchingMask:NSAnyEventMask - untilDate:[NSDate distantPast] - inMode:NSDefaultRunLoopMode - dequeue:YES]; + NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask + untilDate:[NSDate distantPast] + inMode:NSDefaultRunLoopMode + dequeue:YES]; + if (event == nil) + break; - if (event) - [NSApp sendEvent:event]; + [NSApp sendEvent:event]; } - while (event); [_glfwLibrary.NS.autoreleasePool drain]; _glfwLibrary.NS.autoreleasePool = [[NSAutoreleasePool alloc] init];