X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d48b06bd9039597545de9a862501d57c5f9ec1ea..7d45a79353bb57b98326567ab8dae73a224127dc:/src/mgl/app.cpp diff --git a/src/mgl/app.cpp b/src/mgl/app.cpp index a43beb61f1..fc87f16acb 100644 --- a/src/mgl/app.cpp +++ b/src/mgl/app.cpp @@ -44,56 +44,6 @@ void wxApp::Exit() exit(0); } -//----------------------------------------------------------------------------- -// wxYield -//----------------------------------------------------------------------------- - -bool wxApp::DoYield(bool onlyIfNeeded, long eventsToProcess) -{ - if ( m_isInsideYield ) - { - if ( !onlyIfNeeded ) - { - wxFAIL_MSG( wxT("wxYield called recursively" ) ); - } - - return false; - } - -#if wxUSE_THREADS - if ( !wxThread::IsMain() ) - { - // can't process events from other threads, MGL is thread-unsafe - return true; - } -#endif // wxUSE_THREADS - - m_isInsideYield = true; - m_eventsToProcessInsideYield = eventsToProcess; - - wxLog::Suspend(); - - wxEventLoopBase * const eventLoop = wxEventLoop::GetActive(); - if ( eventLoop ) - { - // TODO: implement event filtering using the eventsToProcess mask - - while (eventLoop->Pending()) - eventLoop->Dispatch(); - } - - /* it's necessary to call ProcessIdle() to update the frames sizes which - might have been changed (it also will update other things set from - OnUpdateUI() which is a nice (and desired) side effect) */ - while (wxTheApp->ProcessIdle()) { } - - wxLog::Resume(); - - m_isInsideYield = false; - - return true; -} - //----------------------------------------------------------------------------- // wxWakeUpIdle @@ -252,13 +202,12 @@ bool wxApp::OnInitGui() if ( !wxAppBase::OnInitGui() ) return false; -#ifdef __WXDEBUG__ // MGL redirects stdout and stderr to physical console, so lets redirect - // it to file in debug build. Do it only when WXSTDERR environment variable is set + // it to file if WXSTDERR environment variable is set to be able to see + // wxLogDebug() output wxString redirect; if ( wxGetEnv(wxT("WXSTDERR"), &redirect) ) freopen(redirect.mb_str(), "wt", stderr); -#endif // __WXDEBUG__ wxLog *oldLog = wxLog::SetActiveTarget(new wxLogGui); if ( oldLog ) delete oldLog;