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:
parent
18c7af7e80
commit
757b694ba8
@ -31,6 +31,10 @@ public:
|
||||
// returns DirectFB event buffer used by wx
|
||||
static wxIDirectFBEventBufferPtr GetDirectFBEventBuffer();
|
||||
|
||||
// wxYield implementation: iterate the loop as long as there are any
|
||||
// pending events
|
||||
void Yield();
|
||||
|
||||
protected:
|
||||
virtual void WakeUp();
|
||||
virtual void OnNextIteration();
|
||||
|
@ -138,10 +138,7 @@ bool wxApp::Yield(bool onlyIfNeeded)
|
||||
wxLog::Suspend();
|
||||
|
||||
if ( wxEventLoop::GetActive() )
|
||||
{
|
||||
while (wxEventLoop::GetActive()->Pending())
|
||||
wxEventLoop::GetActive()->Dispatch();
|
||||
}
|
||||
wxEventLoop::GetActive()->Yield();
|
||||
|
||||
// it's necessary to call ProcessIdle() to update the frames sizes which
|
||||
// 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
|
||||
// time out after a brief period in order to make sure that
|
||||
// OnNextIteration() will be called frequently enough
|
||||
//
|
||||
// FIXME: call NotifyTimers() and wxSocketEventDispatcher::RunLoop() from here
|
||||
// (and loop) instead?
|
||||
const int TIMEOUT = 100;
|
||||
|
||||
if ( ms_buffer->WaitForEventWithTimeout(0, TIMEOUT) )
|
||||
@ -127,8 +124,6 @@ void wxEventLoop::WakeUp()
|
||||
|
||||
void wxEventLoop::OnNextIteration()
|
||||
{
|
||||
// see the comment in Dispatch
|
||||
|
||||
#if wxUSE_TIMER
|
||||
wxTimer::NotifyTimers();
|
||||
#endif
|
||||
@ -139,6 +134,16 @@ void wxEventLoop::OnNextIteration()
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxEventLoop::Yield()
|
||||
{
|
||||
// process all pending events:
|
||||
while ( Pending() )
|
||||
Dispatch();
|
||||
|
||||
// handle timers, sockets etc.
|
||||
OnNextIteration();
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// DirectFB -> wxWidgets events translation
|
||||
|
Loading…
Reference in New Issue
Block a user