1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

Bug 1221 (Mac)

Re-instated conditional code that apparently worked previously on Mac.  Untested on Mac.  Could 1221 possibly be cleared now?
This commit is contained in:
James Crook 2015-10-10 15:41:59 +01:00
parent 6d95e68dad
commit 96d2e66db5

View File

@ -174,7 +174,12 @@ void BatchProcessDialog::OnApplyToProject(wxCommandEvent & WXUNUSED(event))
pD->Move(-1, 0); pD->Move(-1, 0);
pD->Show(); pD->Show();
Hide();// Caused Bug #1221 // The Hide() on the next line seems to tickle a bug in wx3,
// giving rise to our Bug #1221. The problem is that on Linux
// the 'Hide' converts us from a Modal into a regular dialog,
// as far as closing is concerned. On Linux we can't close with
// EndModal() anymore after this.
Hide();
gPrefs->Write(wxT("/Batch/ActiveChain"), name); gPrefs->Write(wxT("/Batch/ActiveChain"), name);
gPrefs->Flush(); gPrefs->Flush();
@ -191,15 +196,18 @@ void BatchProcessDialog::OnApplyToProject(wxCommandEvent & WXUNUSED(event))
Show(); Show();
return; return;
} }
// pD->Destroy();
wxWindow * pWnd = this->GetParent(); wxWindow * pWnd = this->GetParent();
// Under Linux an EndModal() here is the cause of Bug #1221. #if !defined(__WXMAC__)
// Under Linux an EndModal() here crashes (Bug #1221).
// But sending a close message instead is OK. // But sending a close message instead is OK.
wxCloseEvent Evt; wxCloseEvent Evt;
Evt.SetId( wxID_OK ); Evt.SetId( wxID_OK );
Evt.SetEventObject( this); Evt.SetEventObject( this);
ProcessWindowEvent( Evt ); ProcessWindowEvent( Evt );
#else
EndModal(wxID_OK);
#endif
pWnd->SetFocus(); pWnd->SetFocus();
} }
@ -361,20 +369,27 @@ void BatchProcessDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
project->OnRemoveTracks(); project->OnRemoveTracks();
wxWindow * pWnd = this->GetParent(); wxWindow * pWnd = this->GetParent();
// Under Linux an EndModal() here is the cause of Bug #1221. // Under Linux an EndModal() here crashes (Bug #1221).
// But sending a close message instead is OK. // But sending a close message instead is OK.
#if !defined(__WXMAC__)
wxCloseEvent Evt; wxCloseEvent Evt;
Evt.SetId( wxID_OK ); Evt.SetId( wxID_OK );
Evt.SetEventObject( this); Evt.SetEventObject( this);
ProcessWindowEvent( Evt ); ProcessWindowEvent( Evt );
#else
EndModal(wxID_OK);
#endif
pWnd->SetFocus(); pWnd->SetFocus();
} }
void BatchProcessDialog::OnCancel(wxCommandEvent & WXUNUSED(event)) void BatchProcessDialog::OnCancel(wxCommandEvent & WXUNUSED(event))
{ {
#if 1 #if !defined(__WXMAC__)
// It is possible that we could just do EndModal()
// here even on Linux. However, we know the alternative way of
// closing works, if we are hidden, so we hide and then do that.
Hide(); Hide();
// Under Linux an EndModal() here is the cause of Bug #1221. // Under Linux an EndModal() here potentially crashes (Bug #1221).
// But sending a close message instead is OK. // But sending a close message instead is OK.
wxCloseEvent Evt; wxCloseEvent Evt;
Evt.SetId( wxID_CANCEL ); Evt.SetId( wxID_CANCEL );