X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f212e222e736f9f24d86edb5717508a159c38692..94f0292941b6520afbabc999da698ef5fe576a46:/src/x11/app.cpp?ds=sidebyside diff --git a/src/x11/app.cpp b/src/x11/app.cpp index 4c9868ce0c..e37d35ad28 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -769,7 +769,7 @@ void wxApp::Exit() // Yield to other processes -bool wxApp::Yield(bool onlyIfNeeded) +bool wxApp::DoYield(bool onlyIfNeeded, long eventsToProcess) { // Sometimes only 2 yields seem // to do the trick, e.g. in the @@ -777,9 +777,7 @@ bool wxApp::Yield(bool onlyIfNeeded) int i; for (i = 0; i < 2; i++) { - static bool s_inYield = false; - - if ( s_inYield ) + if ( m_isInsideYield ) { if ( !onlyIfNeeded ) { @@ -789,15 +787,18 @@ bool wxApp::Yield(bool onlyIfNeeded) return false; } - s_inYield = true; + m_isInsideYield = true; + m_eventsToProcessInsideYield = eventsToProcess; // Make sure we have an event loop object, // or Pending/Dispatch will fail - wxEventLoopGuarantor dummyLoopIfNeeded; + wxEventLoopGuarantor dummyLoopIfNeeded; + // Call dispatch at least once so that sockets // can be tested wxTheApp->Dispatch(); + // TODO: implement event filtering using the eventsToProcess mask while (wxTheApp && wxTheApp->Pending()) wxTheApp->Dispatch(); @@ -806,7 +807,7 @@ bool wxApp::Yield(bool onlyIfNeeded) #endif ProcessIdle(); - s_inYield = false; + m_isInsideYield = false; } return true;