X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0b6f851f4ac593595c59f0e4ecf1caa48c572564..289532452089421ddadbd4726a8469511a19ab76:/src/osx/cocoa/evtloop.mm diff --git a/src/osx/cocoa/evtloop.mm b/src/osx/cocoa/evtloop.mm index 11e9d21129..89957cd2bd 100644 --- a/src/osx/cocoa/evtloop.mm +++ b/src/osx/cocoa/evtloop.mm @@ -179,6 +179,16 @@ void wxGUIEventLoop::DoRun() void wxGUIEventLoop::DoStop() { [NSApp stop:0]; + // only calling stop: is not enough when called from a runloop-observer, + // therefore add a dummy event, to make sure the runloop gets another round + NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined + location:NSMakePoint(0.0, 0.0) + modifierFlags:0 + timestamp:0 + windowNumber:0 + context:nil + subtype:0 data1:0 data2:0]; + [NSApp postEvent:event atStart:FALSE]; } CFRunLoopRef wxGUIEventLoop::CFGetCurrentRunLoop() const