From 7df52b73bdf3cb0a17d188508b360c6042466333 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Mon, 3 Feb 2014 17:40:43 +0000 Subject: [PATCH] =?UTF-8?q?passing=20correct=20timeout=20values,=20patch?= =?UTF-8?q?=20from=20V=C3=A1clav?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75777 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/cocoa/evtloop.mm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/osx/cocoa/evtloop.mm b/src/osx/cocoa/evtloop.mm index d571d0484c..5e4a869394 100644 --- a/src/osx/cocoa/evtloop.mm +++ b/src/osx/cocoa/evtloop.mm @@ -202,19 +202,18 @@ int wxGUIEventLoop::DoDispatchTimeout(unsigned long timeout) { if ( [[NSApplication sharedApplication] nextEventMatchingMask: NSAnyEventMask - untilDate: nil + untilDate: [NSDate dateWithTimeIntervalSinceNow: timeout/1000.0] inMode: NSDefaultRunLoopMode dequeue: NO] != nil ) return 1; return -1; } - case NSRunStoppedResponse: case NSRunAbortedResponse: return -1; default: - wxFAIL_MSG("unknown response code"); + // nested native loops may return other codes here, just ignore them break; } return -1; @@ -223,7 +222,7 @@ int wxGUIEventLoop::DoDispatchTimeout(unsigned long timeout) { NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask - untilDate:[NSDate dateWithTimeIntervalSinceNow: timeout/1000] + untilDate:[NSDate dateWithTimeIntervalSinceNow: timeout/1000.0] inMode:NSDefaultRunLoopMode dequeue: YES];