X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dbeddfb93d3479d03d8ec4c0121dfbe3bbcc422b..cc3fcdff183c0af38f23aa57e5b21b419fc8ee61:/src/osx/cocoa/dialog.mm?ds=sidebyside diff --git a/src/osx/cocoa/dialog.mm b/src/osx/cocoa/dialog.mm index e5a9d3f658..4af807536a 100644 --- a/src/osx/cocoa/dialog.mm +++ b/src/osx/cocoa/dialog.mm @@ -45,14 +45,19 @@ void wxDialog::DoShowModal() } */ NSWindow* theWindow = GetWXWindow(); - + NSModalSession session = [NSApp beginModalSessionForWindow:theWindow]; - while (IsModal()) + while (IsModal()) { wxMacAutoreleasePool autoreleasepool; - if ([NSApp runModalSession:session] != NSRunContinuesResponse) - break; - // TODO should we do some idle processing ? + // we cannot break based on the return value, because nested + // alerts might set this to stopped as well, so it would be + // unsafe + [NSApp runModalSession:session]; + + // do some idle processing + if (wxTheApp) + wxTheApp->ProcessIdle(); } [NSApp endModalSession:session];