X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b513212d2eab4daacd56606d6c7d489639e3215b..51c14c62de196194888500db35085043c5f9bbbf:/src/x11/evtloop.cpp diff --git a/src/x11/evtloop.cpp b/src/x11/evtloop.cpp index a6bdaeb2f7..ebe1ebb13a 100644 --- a/src/x11/evtloop.cpp +++ b/src/x11/evtloop.cpp @@ -42,8 +42,8 @@ public: // ctor wxEventLoopImpl() { SetExitCode(0); m_keepGoing = FALSE; } - // process an XEvent - void ProcessEvent(XEvent* event); + // process an XEvent, return TRUE if it was processed + bool ProcessEvent(XEvent* event); // generate an idle message, return TRUE if more idle time requested bool SendIdleEvent(); @@ -71,15 +71,17 @@ public: // wxEventLoopImpl message processing // ---------------------------------------------------------------------------- -void wxEventLoopImpl::ProcessEvent(XEvent *event) +bool wxEventLoopImpl::ProcessEvent(XEvent *event) { // give us the chance to preprocess the message first - if ( !PreProcessEvent(event) ) - { - // if it wasn't done, dispatch it to the corresponding window - if (wxTheApp) - wxTheApp->ProcessXEvent((WXEvent*) event); - } + if ( PreProcessEvent(event) ) + return TRUE; + + // if it wasn't done, dispatch it to the corresponding window + if (wxTheApp) + return wxTheApp->ProcessXEvent((WXEvent*) event); + + return FALSE; } bool wxEventLoopImpl::PreProcessEvent(XEvent *event) @@ -163,7 +165,9 @@ int wxEventLoop::Run() // anything else to do while ( ! Pending() ) { +#if wxUSE_TIMER wxTimer::NotifyTimers(); // TODO: is this the correct place for it? +#endif if (!m_impl->SendIdleEvent()) { #if 0 // wxUSE_THREADS @@ -220,7 +224,7 @@ bool wxEventLoop::Dispatch() // TODO allowing for threads, as per e.g. wxMSW XNextEvent((Display*) wxGetDisplay(), & event); - m_impl->ProcessEvent(& event); + (void) m_impl->ProcessEvent(& event); return TRUE; }