From d1206a3f88f91bb241ffba0e28b1b76b050cf865 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Mon, 3 Feb 2014 17:44:10 +0000 Subject: [PATCH] backport from trunk git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75778 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];