wxDFB: fix events processing to support sockets events
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43999 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -31,6 +31,10 @@ public:
|
|||||||
// returns DirectFB event buffer used by wx
|
// returns DirectFB event buffer used by wx
|
||||||
static wxIDirectFBEventBufferPtr GetDirectFBEventBuffer();
|
static wxIDirectFBEventBufferPtr GetDirectFBEventBuffer();
|
||||||
|
|
||||||
|
// wxYield implementation: iterate the loop as long as there are any
|
||||||
|
// pending events
|
||||||
|
void Yield();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void WakeUp();
|
virtual void WakeUp();
|
||||||
virtual void OnNextIteration();
|
virtual void OnNextIteration();
|
||||||
|
@@ -138,10 +138,7 @@ bool wxApp::Yield(bool onlyIfNeeded)
|
|||||||
wxLog::Suspend();
|
wxLog::Suspend();
|
||||||
|
|
||||||
if ( wxEventLoop::GetActive() )
|
if ( wxEventLoop::GetActive() )
|
||||||
{
|
wxEventLoop::GetActive()->Yield();
|
||||||
while (wxEventLoop::GetActive()->Pending())
|
|
||||||
wxEventLoop::GetActive()->Dispatch();
|
|
||||||
}
|
|
||||||
|
|
||||||
// it's necessary to call ProcessIdle() to update the frames sizes which
|
// it's necessary to call ProcessIdle() to update the frames sizes which
|
||||||
// might have been changed (it also will update other things set from
|
// might have been changed (it also will update other things set from
|
||||||
|
@@ -86,9 +86,6 @@ bool wxEventLoop::Dispatch()
|
|||||||
// NB: we don't block indefinitely waiting for an event, but instead
|
// NB: we don't block indefinitely waiting for an event, but instead
|
||||||
// time out after a brief period in order to make sure that
|
// time out after a brief period in order to make sure that
|
||||||
// OnNextIteration() will be called frequently enough
|
// OnNextIteration() will be called frequently enough
|
||||||
//
|
|
||||||
// FIXME: call NotifyTimers() and wxSocketEventDispatcher::RunLoop() from here
|
|
||||||
// (and loop) instead?
|
|
||||||
const int TIMEOUT = 100;
|
const int TIMEOUT = 100;
|
||||||
|
|
||||||
if ( ms_buffer->WaitForEventWithTimeout(0, TIMEOUT) )
|
if ( ms_buffer->WaitForEventWithTimeout(0, TIMEOUT) )
|
||||||
@@ -127,8 +124,6 @@ void wxEventLoop::WakeUp()
|
|||||||
|
|
||||||
void wxEventLoop::OnNextIteration()
|
void wxEventLoop::OnNextIteration()
|
||||||
{
|
{
|
||||||
// see the comment in Dispatch
|
|
||||||
|
|
||||||
#if wxUSE_TIMER
|
#if wxUSE_TIMER
|
||||||
wxTimer::NotifyTimers();
|
wxTimer::NotifyTimers();
|
||||||
#endif
|
#endif
|
||||||
@@ -139,6 +134,16 @@ void wxEventLoop::OnNextIteration()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxEventLoop::Yield()
|
||||||
|
{
|
||||||
|
// process all pending events:
|
||||||
|
while ( Pending() )
|
||||||
|
Dispatch();
|
||||||
|
|
||||||
|
// handle timers, sockets etc.
|
||||||
|
OnNextIteration();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// DirectFB -> wxWidgets events translation
|
// DirectFB -> wxWidgets events translation
|
||||||
|
Reference in New Issue
Block a user