// 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();
 
     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
 
     // 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) )
 
 void wxEventLoop::OnNextIteration()
 {
-    // see the comment in Dispatch
-
 #if wxUSE_TIMER
     wxTimer::NotifyTimers();
 #endif
 #endif
 }
 
+void wxEventLoop::Yield()
+{
+    // process all pending events:
+    while ( Pending() )
+        Dispatch();
+
+    // handle timers, sockets etc.
+    OnNextIteration();
+}
+
 
 //-----------------------------------------------------------------------------
 // DirectFB -> wxWidgets events translation