X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d48b06bd9039597545de9a862501d57c5f9ec1ea..534f87c6c442aa2710a44352bd26d215fec1714b:/src/dfb/evtloop.cpp diff --git a/src/dfb/evtloop.cpp b/src/dfb/evtloop.cpp index d18b73a251..9dc00616db 100644 --- a/src/dfb/evtloop.cpp +++ b/src/dfb/evtloop.cpp @@ -3,7 +3,6 @@ // Purpose: wxEventLoop implementation // Author: Vaclav Slavik // Created: 2006-08-16 -// RCS-ID: $Id$ // Copyright: (c) 2006 REA Elektronik GmbH // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -23,6 +22,7 @@ #ifndef WX_PRECOMP #include "wx/app.h" + #include "wx/log.h" #endif #include "wx/thread.h" @@ -202,8 +202,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 +224,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; }