- if ( modal )
- {
- s_macIsInModalLoop = true ;
- if (show)
- {
- if (m_modalShowing)
- {
-// BringWindowToTop((HWND) GetHWND());
- return TRUE;
- }
-
- m_modalShowing = TRUE;
- // if we don't do it, some window might be deleted while we have pointers
- // to them in our disabledWindows list and the program will crash when it
- // will try to reenable them after the modal dialog end
- wxTheApp->DeletePendingObjects();
-
- UMAShowWindow( m_macWindowData->m_macWindow ) ;
- UMASelectWindow( m_macWindowData->m_macWindow ) ;
-
- if (!wxModalDialogs.Member(this))
- wxModalDialogs.Append(this);
-
- while (wxModalDialogs.Member(this) )
- {
- wxTheApp->MacDoOneEvent() ;
- }
- }
- else
- {
- wxModalDialogs.DeleteObject(this);
- UMAHideWindow( m_macWindowData->m_macWindow ) ;
- }
- s_macIsInModalLoop = false ;
- }
- else // !modal
+ bool formerModal = s_macIsInModalLoop ;
+ s_macIsInModalLoop = true ;
+
+ while ( IsModalShowing() )