X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/757b694ba86ee675b6028aed470611a6ef302491..2e53e220c27c900b456222ad4834b17a389a781b:/src/dfb/evtloop.cpp diff --git a/src/dfb/evtloop.cpp b/src/dfb/evtloop.cpp index 2ecc94a9b4..c4c6c3bdeb 100644 --- a/src/dfb/evtloop.cpp +++ b/src/dfb/evtloop.cpp @@ -25,9 +25,11 @@ #include "wx/app.h" #endif +#include "wx/thread.h" #include "wx/timer.h" -#include "wx/private/socketevtdispatch.h" +#include "wx/private/selectdispatcher.h" #include "wx/dfb/private.h" +#include "wx/nonownedwnd.h" #define TRACE_EVENTS _T("events") @@ -88,7 +90,16 @@ bool wxEventLoop::Dispatch() // OnNextIteration() will be called frequently enough const int TIMEOUT = 100; - if ( ms_buffer->WaitForEventWithTimeout(0, TIMEOUT) ) + // release the GUI mutex so that other threads have a chance to post + // events: + wxMutexGuiLeave(); + + bool rv = ms_buffer->WaitForEventWithTimeout(0, TIMEOUT); + + // and acquire it back before calling any event handlers: + wxMutexGuiEnter(); + + if ( rv ) { switch ( ms_buffer->GetLastResult() ) { @@ -130,7 +141,7 @@ void wxEventLoop::OnNextIteration() #if wxUSE_SOCKETS // handle any pending socket events: - wxSocketEventDispatcher::Get().RunLoop(); + wxSelectDispatcher::Get().RunLoop(0); #endif } @@ -156,7 +167,7 @@ void wxEventLoop::HandleDFBEvent(const wxDFBEvent& event) case DFEC_WINDOW: { wxDFBWindowEvent winevent(((const DFBEvent&)event).window); - wxTopLevelWindowDFB::HandleDFBWindowEvent(winevent); + wxNonOwnedWindow::HandleDFBWindowEvent(winevent); break; }