X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e32f4a9fa9de5c47574e5ee16c4d8afade3b0d34..d2699196d3099c3659850ba934a24e205184d8d4:/src/mac/carbon/app.cpp?ds=sidebyside diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index 04f3eee3b5..fd5c1b0d4f 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -322,12 +322,12 @@ MenuEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) &menuRef); #endif // 0 - wxMenuEvent event(GetEventKind(event) == kEventMenuOpening + wxMenuEvent wxevent(GetEventKind(event) == kEventMenuOpening ? wxEVT_MENU_OPEN : wxEVT_MENU_CLOSE); - event.SetEventObject(win); + wxevent.SetEventObject(win); - (void)win->GetEventHandler()->ProcessEvent(event); + (void)win->GetEventHandler()->ProcessEvent(wxevent); } return eventNotHandledErr; @@ -970,12 +970,6 @@ pascal OSStatus wxMacApplicationEventHandler( EventHandlerCallRef handler , Even wxApp::wxApp() { - m_topWindow = NULL; - wxTheApp = this; - - argc = 0; - argv = NULL; - m_printMode = wxPRINT_WINDOWS; m_auto3D = TRUE; } @@ -1025,33 +1019,13 @@ void wxApp::Dispatch() void wxApp::OnIdle(wxIdleEvent& event) { - // Avoid recursion (via ProcessEvent default case) - if ( s_inOnIdle ) - return; - - - s_inOnIdle = TRUE; - - // 'Garbage' collection of windows deleted with Close(). - DeletePendingObjects(); - - // flush the logged messages if any - wxLog *pLog = wxLog::GetActiveTarget(); - if ( pLog != NULL && pLog->HasPendingMessages() ) - pLog->Flush(); - - // Send OnIdle events to all windows - bool needMore = SendIdleEvents(); - - if (needMore) - event.RequestMore(TRUE); - + wxAppBase::OnIdle(event); + // If they are pending events, we must process them: pending events are // either events to the threads other than main or events posted with // wxPostEvent() functions wxMacProcessNotifierAndPendingEvents(); - s_inOnIdle = FALSE; if(!wxMenuBar::MacGetInstalledMenuBar() && wxMenuBar::MacGetCommonMenuBar()) wxMenuBar::MacGetCommonMenuBar()->MacInstallMenuBar(); }