backport: fixing modal dialog quit after nested message box problem

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_9_0_BRANCH@60964 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2009-06-10 05:07:06 +00:00
parent 4c872ab7a7
commit 099a8b6c90

View File

@@ -47,12 +47,15 @@ void wxDialog::DoShowModal()
NSWindow* theWindow = GetWXWindow(); NSWindow* theWindow = GetWXWindow();
NSModalSession session = [NSApp beginModalSessionForWindow:theWindow]; NSModalSession session = [NSApp beginModalSessionForWindow:theWindow];
int response = 0;
while (IsModal()) while (IsModal())
{ {
wxMacAutoreleasePool autoreleasepool; wxMacAutoreleasePool autoreleasepool;
if ([NSApp runModalSession:session] != NSRunContinuesResponse) // we cannot break based on the return value, because nested
break; // alerts might set this to stopped as well, so it would be
// TODO should we do some idle processing ? // unsafe
[NSApp runModalSession:session];
// TODO Idle
} }
[NSApp endModalSession:session]; [NSApp endModalSession:session];