X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a69561317309e7b6d29dbdd3465e16f8ceba8fb7..7c60222510bc5e197b12f153c4bf05db66cb0f4a:/src/osx/core/evtloop_cf.cpp diff --git a/src/osx/core/evtloop_cf.cpp b/src/osx/core/evtloop_cf.cpp index 20f01f8fd6..7fb81172b2 100644 --- a/src/osx/core/evtloop_cf.cpp +++ b/src/osx/core/evtloop_cf.cpp @@ -163,13 +163,13 @@ void wxCFEventLoop::CommonModeObserverCallBack(CFRunLoopObserverRef WXUNUSED(obs // and this input is only removed from it when pending event handlers are // executed) - if ( wxTheApp ) + if ( wxTheApp && ShouldProcessIdleEvents() ) wxTheApp->ProcessPendingEvents(); } if ( activity & kCFRunLoopBeforeWaiting ) { - if ( m_processIdleEvents && ProcessIdle() ) + if ( ShouldProcessIdleEvents() && ProcessIdle() ) { WakeUp(); } @@ -203,6 +203,10 @@ wxCFEventLoop::wxCFEventLoop() m_shouldExit = false; m_processIdleEvents = true; +#if wxUSE_UIACTIONSIMULATOR + m_shouldWaitForEvent = false; +#endif + m_runLoop = CFGetCurrentRunLoop(); CFRunLoopObserverContext ctxt; @@ -298,7 +302,17 @@ bool wxCFEventLoop::Pending() const int wxCFEventLoop::DoProcessEvents() { - return DispatchTimeout( 0 ); +#if wxUSE_UIACTIONSIMULATOR + if ( m_shouldWaitForEvent ) + { + int handled = DispatchTimeout( 1000 ); + wxASSERT_MSG( handled == 1, "No Event Available"); + m_shouldWaitForEvent = false; + return handled; + } + else +#endif + return DispatchTimeout( 0 ); } bool wxCFEventLoop::Dispatch() @@ -445,14 +459,19 @@ wxCFEventLoopPauseIdleEvents::wxCFEventLoopPauseIdleEvents() { wxCFEventLoop* cfl = dynamic_cast(wxEventLoopBase::GetActive()); if ( cfl ) + { + m_formerState = cfl->ShouldProcessIdleEvents(); cfl->SetProcessIdleEvents(false); + } + else + m_formerState = true; } wxCFEventLoopPauseIdleEvents::~wxCFEventLoopPauseIdleEvents() { wxCFEventLoop* cfl = dynamic_cast(wxEventLoopBase::GetActive()); if ( cfl ) - cfl->SetProcessIdleEvents(true); + cfl->SetProcessIdleEvents(m_formerState); } // TODO Move to thread_osx.cpp