X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fdf7ff738cb755be0e9e7e1378d8c3073f08f0e1..54e18afcca6b75bfaf9dd1f12f4a255df8ae089d:/src/common/selectdispatcher.cpp diff --git a/src/common/selectdispatcher.cpp b/src/common/selectdispatcher.cpp index ffcf387179..990b62c21c 100644 --- a/src/common/selectdispatcher.cpp +++ b/src/common/selectdispatcher.cpp @@ -190,8 +190,9 @@ bool wxSelectDispatcher::UnregisterFD(int fd) return true; } -void wxSelectDispatcher::ProcessSets(const wxSelectSets& sets) +bool wxSelectDispatcher::ProcessSets(const wxSelectSets& sets) { + bool gotEvent = false; for ( int fd = 0; fd <= m_maxFD; fd++ ) { if ( !sets.HasFD(fd) ) @@ -204,11 +205,15 @@ void wxSelectDispatcher::ProcessSets(const wxSelectSets& sets) continue; } + gotEvent = true; + sets.Handle(fd, *handler); } + + return gotEvent; } -void wxSelectDispatcher::Dispatch(int timeout) +bool wxSelectDispatcher::Dispatch(int timeout) { struct timeval tv, *ptv; @@ -240,8 +245,12 @@ void wxSelectDispatcher::Dispatch(int timeout) break; default: - ProcessSets(sets); + if ( ProcessSets(sets) ) + return true; } + + // nothing happened + return false; } #endif // wxUSE_SELECT_DISPATCHER