]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/app.cpp
process pending wx events before sending idle events
[wxWidgets.git] / src / mac / carbon / app.cpp
index 683d9c7401786ff1271228917bb942245fc58857..d833bb02d7991dd3ae80f69dc13cc3cddf3aa80f 100644 (file)
@@ -1136,12 +1136,7 @@ wxApp::wxApp()
 
 void wxApp::OnIdle(wxIdleEvent& event)
 {
-    wxAppBase::OnIdle(event);
-
-    // If they are pending events, we must process them: pending events are
-    // either events to the threads other than main or events posted with
-    // wxPostEvent() functions
-    wxMacProcessNotifierAndPendingEvents();
+    wxMacProcessNotifierEvents();
 
   if (!wxMenuBar::MacGetInstalledMenuBar() && wxMenuBar::MacGetCommonMenuBar())
     wxMenuBar::MacGetCommonMenuBar()->MacInstallMenuBar();
@@ -1196,6 +1191,15 @@ bool wxApp::Yield(bool onlyIfNeeded)
         return false;
     }
 
+#if wxUSE_THREADS
+    // Yielding from a non-gui thread needs to bail out, otherwise we end up
+    // possibly sending events in the thread too.
+    if ( !wxThread::IsMain() )
+    {
+        return true;
+    }
+#endif // wxUSE_THREADS
+
     s_inYield = true;
 
     // by definition yield should handle all non-processed events