1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-29 00:30:23 +01:00

Bug1511: REBUILD WXWIDGETS: Mac Quit via tooldock doesn't crash...

... in case at least three projects are open, or skip save prompts either,
in case at least two projects with unsaved changes are open.
This commit is contained in:
Paul Licameli
2016-10-03 14:29:42 -04:00
parent 412d651e6e
commit ea1015596c
4 changed files with 75 additions and 1 deletions

View File

@@ -744,7 +744,8 @@ void AudacityApp::MacNewFile()
#define kAudacityAppTimerID 0
BEGIN_EVENT_TABLE(AudacityApp, wxApp)
EVT_QUERY_END_SESSION(AudacityApp::OnEndSession)
EVT_QUERY_END_SESSION(AudacityApp::OnQueryEndSession)
EVT_END_SESSION(AudacityApp::OnEndSession)
EVT_TIMER(kAudacityAppTimerID, AudacityApp::OnTimer)
#ifdef __WXMAC__
@@ -1974,6 +1975,20 @@ void AudacityApp::FindFilesInPathList(const wxString & pattern,
}
}
void AudacityApp::OnQueryEndSession(wxCloseEvent & event)
{
bool mustVeto = false;
#ifdef __WXMAC__
mustVeto = wxDialog::OSXHasModalDialogsOpen();
#endif
if ( mustVeto )
event.Veto(true);
else
OnEndSession(event);
}
void AudacityApp::OnEndSession(wxCloseEvent & event)
{
bool force = !event.CanVeto();

View File

@@ -205,6 +205,7 @@ class AudacityApp final : public wxApp {
void OnMenuPreferences(wxCommandEvent & event);
void OnMenuExit(wxCommandEvent & event);
void OnQueryEndSession(wxCloseEvent & event);
void OnEndSession(wxCloseEvent & event);
// Most Recently Used File support (for all platforms).