X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a1873279648582e6af46f9103460da50bf5e03b9..6362d82b3ed82aa6795e4ad03160820f94c9e4d4:/src/unix/evtloopunix.cpp diff --git a/src/unix/evtloopunix.cpp b/src/unix/evtloopunix.cpp index 39afb42db0..fc1f469ae4 100644 --- a/src/unix/evtloopunix.cpp +++ b/src/unix/evtloopunix.cpp @@ -27,6 +27,7 @@ #endif #include +#include "wx/apptrait.h" #include "wx/evtloop.h" #include "wx/thread.h" #include "wx/module.h" @@ -125,15 +126,9 @@ wxConsoleEventLoop::wxConsoleEventLoop() return; } -#ifdef wxUSE_EPOLL_DISPATCHER - m_dispatcher = wxEpollDispatcher::Get(); + m_dispatcher = wxFDIODispatcher::Get(); if ( !m_dispatcher ) -#endif // wxUSE_EPOLL_DISPATCHER -#if wxUSE_SELECT_DISPATCHER - m_dispatcher = wxSelectDispatcher::Get(); -#endif // wxUSE_WCHAR_T - - wxCHECK_RET( m_dispatcher, _T("failed to create IO dispatcher") ); + return; m_dispatcher->RegisterFD ( @@ -153,17 +148,6 @@ bool wxConsoleEventLoop::Pending() const } bool wxConsoleEventLoop::Dispatch() -{ - wxTheApp->ProcessPendingEvents(); - return true; -} - -void wxConsoleEventLoop::WakeUp() -{ - m_wakeupPipe.WakeUp(); -} - -void wxConsoleEventLoop::OnNextIteration() { // calculate the timeout until the next timer expiration int timeout; @@ -181,14 +165,31 @@ void wxConsoleEventLoop::OnNextIteration() timeout = wxFDIODispatcher::TIMEOUT_INFINITE; } - m_dispatcher->RunLoop(timeout); + m_dispatcher->Dispatch(timeout); #if wxUSE_TIMER wxTimerScheduler::Get().NotifyExpired(); #endif + wxTheApp->ProcessPendingEvents(); + return true; +} + +void wxConsoleEventLoop::WakeUp() +{ + m_wakeupPipe.WakeUp(); +} + +void wxConsoleEventLoop::OnNextIteration() +{ // call the signal handlers for any signals we caught recently wxTheApp->CheckSignal(); } + +wxEventLoopBase *wxConsoleAppTraits::CreateEventLoop() +{ + return new wxEventLoop(); +} + #endif // wxUSE_CONSOLE_EVENTLOOP