X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a930afc71b5aeac3ef8eaa406be948828aed3469..0728199b911be9095406cf05059a5a180e707778:/src/mac/carbon/app.cpp diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index 683d9c7401..d833bb02d7 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -1136,12 +1136,7 @@ wxApp::wxApp() void wxApp::OnIdle(wxIdleEvent& event) { - 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(); + wxMacProcessNotifierEvents(); if (!wxMenuBar::MacGetInstalledMenuBar() && wxMenuBar::MacGetCommonMenuBar()) wxMenuBar::MacGetCommonMenuBar()->MacInstallMenuBar(); @@ -1196,6 +1191,15 @@ bool wxApp::Yield(bool onlyIfNeeded) return false; } +#if wxUSE_THREADS + // Yielding from a non-gui thread needs to bail out, otherwise we end up + // possibly sending events in the thread too. + if ( !wxThread::IsMain() ) + { + return true; + } +#endif // wxUSE_THREADS + s_inYield = true; // by definition yield should handle all non-processed events