mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-01 16:39:30 +02: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:
parent
412d651e6e
commit
ea1015596c
@ -41,6 +41,7 @@ http://forum.audacityteam.org/viewtopic.php?p=303835#p303835 .
|
||||
patch -p0 -i <path to Audacity source>/mac/wxMac_additions/pinch-spread.patch .
|
||||
patch -p0 -i <path to Audacity source>/mac/wxMac_additions/focusrings.patch .
|
||||
patch -p0 -i <path to Audacity source>/mac/wxMac_additions/wxMac-3.0.2-wxaccessible.patch .
|
||||
patch -p0 -i <path to Audacity source>/mac/wxMac_additions/tooldock-quit.patch .
|
||||
|
||||
10) And finally build/install wxWidgets:
|
||||
|
||||
|
57
mac/wxMac_additions/tooldock-quit.patch
Normal file
57
mac/wxMac_additions/tooldock-quit.patch
Normal file
@ -0,0 +1,57 @@
|
||||
From 343528d045e805b84e2c4df2bacdf4d319906084 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Licameli <paul.licameli@audacityteam.org>
|
||||
Date: Mon, 3 Oct 2016 13:58:26 -0400
|
||||
Subject: [PATCH] Quitting app via Mac tooldock uses events, so behavior is
|
||||
overridable
|
||||
|
||||
---
|
||||
src/osx/carbon/app.cpp | 20 +++++++++++---------
|
||||
1 file changed, 11 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/osx/carbon/app.cpp b/src/osx/carbon/app.cpp
|
||||
index 0926dbf..bdb78ca 100644
|
||||
--- src/osx/carbon/app.cpp
|
||||
+++ src/osx/carbon/app.cpp
|
||||
@@ -259,12 +259,9 @@ short wxApp::MacHandleAEOApp(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNU
|
||||
|
||||
short wxApp::MacHandleAEQuit(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNUSED(reply))
|
||||
{
|
||||
- wxCloseEvent event;
|
||||
- wxTheApp->OnQueryEndSession(event);
|
||||
- if ( !event.GetVeto() )
|
||||
+ if ( OSXOnShouldTerminate() )
|
||||
{
|
||||
- wxCloseEvent event;
|
||||
- wxTheApp->OnEndSession(event);
|
||||
+ OSXOnWillTerminate();
|
||||
}
|
||||
return noErr ;
|
||||
}
|
||||
@@ -421,15 +418,20 @@ void wxApp::OSXOnDidFinishLaunching()
|
||||
|
||||
void wxApp::OSXOnWillTerminate()
|
||||
{
|
||||
- wxCloseEvent event;
|
||||
+ wxCloseEvent event(wxEVT_END_SESSION, wxID_ANY);
|
||||
+ event.SetEventObject(wxTheApp);
|
||||
event.SetCanVeto(false);
|
||||
- wxTheApp->OnEndSession(event);
|
||||
+
|
||||
+ wxTheApp->ProcessEvent(event);
|
||||
}
|
||||
|
||||
bool wxApp::OSXOnShouldTerminate()
|
||||
{
|
||||
- wxCloseEvent event;
|
||||
- wxTheApp->OnQueryEndSession(event);
|
||||
+ wxCloseEvent event(wxEVT_QUERY_END_SESSION, wxID_ANY);
|
||||
+ event.SetEventObject(wxTheApp);
|
||||
+ event.SetCanVeto(true);
|
||||
+
|
||||
+ wxTheApp->ProcessEvent(event);
|
||||
return !event.GetVeto();
|
||||
}
|
||||
#endif
|
||||
--
|
||||
2.3.2 (Apple Git-55)
|
||||
|
@ -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();
|
||||
|
@ -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).
|
||||
|
Loading…
x
Reference in New Issue
Block a user