X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7816e624f3cc9041de71b4acfe183976624ff833..6a4cbac17af82fdf6b8220b309da74b735d616fb:/src/mac/carbon/app.cpp diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index 4f1c473465..8f8c8f9129 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -133,7 +133,7 @@ pascal OSErr AEHandleRApp( const AppleEvent *event , AppleEvent *reply , SRefCon return wxTheApp->MacHandleAERApp( (AppleEvent*) event , reply) ; } -pascal OSErr AEHandleGURL( const AppleEvent *event , AppleEvent *reply , long WXUNUSED(refcon) ) +pascal OSErr AEHandleGURL( const AppleEvent *event , AppleEvent *reply , SRefCon WXUNUSED(refcon) ) { return wxTheApp->MacHandleAEGURL((WXEVENTREF *)event , reply) ; } @@ -494,7 +494,8 @@ wxMenu* wxFindMenuFromMacCommand( const HICommand &command , wxMenuItem* &item ) // is it part of the application or the Help menu, then look for the id directly if ( ( GetMenuHandle( kwxMacAppleMenuId ) != NULL && command.menu.menuRef == GetMenuHandle( kwxMacAppleMenuId ) ) || - ( helpMenuHandle != NULL && command.menu.menuRef == helpMenuHandle ) ) + ( helpMenuHandle != NULL && command.menu.menuRef == helpMenuHandle ) || + wxMenuBar::MacGetWindowMenuHMenu() != NULL && command.menu.menuRef == wxMenuBar::MacGetWindowMenuHMenu() ) { wxMenuBar* mbar = wxMenuBar::MacGetInstalledMenuBar() ; if ( mbar ) @@ -1135,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(); @@ -1195,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