X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d48b06bd9039597545de9a862501d57c5f9ec1ea..c13d6ac1ea199d1e3908d40d129e2fd5a4d82df7:/src/dfb/evtloop.cpp diff --git a/src/dfb/evtloop.cpp b/src/dfb/evtloop.cpp index d18b73a251..726ea53b51 100644 --- a/src/dfb/evtloop.cpp +++ b/src/dfb/evtloop.cpp @@ -23,6 +23,7 @@ #ifndef WX_PRECOMP #include "wx/app.h" + #include "wx/log.h" #endif #include "wx/thread.h" @@ -202,8 +203,20 @@ wxIDirectFBEventBufferPtr wxGUIEventLoop::GetDirectFBEventBuffer() // events dispatch and loop handling //----------------------------------------------------------------------------- -void wxGUIEventLoop::Yield() +bool wxGUIEventLoop::YieldFor(long eventsToProcess) { +#if wxUSE_THREADS + if ( !wxThread::IsMain() ) + return true; // can't process events from other threads +#endif // wxUSE_THREADS + + m_isInsideYield = true; + m_eventsToProcessInsideYield = eventsToProcess; + +#if wxUSE_LOG + wxLog::Suspend(); +#endif // wxUSE_LOG + // TODO: implement event filtering using the eventsToProcess mask // process all pending events: @@ -212,4 +225,17 @@ void wxGUIEventLoop::Yield() // handle timers, sockets etc. OnNextIteration(); + + // 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 ( ProcessIdle() ) {} + +#if wxUSE_LOG + wxLog::Resume(); +#endif // wxUSE_LOG + + m_isInsideYield = false; + + return true; }