From 074d0daf3de40cc4f42d33c8b986267403781f2d Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Wed, 27 Jan 2016 14:55:49 -0500 Subject: [PATCH 1/2] Revert "Bug1299: Shouldn't lose track focus after applying a chain." This reverts commit a44ff801a6deb8fa259c073057e35b736c1c3272. --- src/Menus.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Menus.cpp b/src/Menus.cpp index 3ab177aa3..80a4c3db4 100644 --- a/src/Menus.cpp +++ b/src/Menus.cpp @@ -6423,8 +6423,7 @@ void AudacityProject::OnEditLabels() void AudacityProject::OnApplyChain() { - // Bug1299: Make Track panel the parent so it gets focus back - BatchProcessDialog dlg(GetTrackPanel()); + BatchProcessDialog dlg(this); dlg.ShowModal(); ModifyUndoMenuItems(); } From c7eca2c6578ca6e12a7144edcd76a1782d73491b Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Wed, 27 Jan 2016 14:58:51 -0500 Subject: [PATCH 2/2] Bug1299 again: Better fix, to restore window focus after applying a chain. --- src/BatchProcessDialog.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/BatchProcessDialog.cpp b/src/BatchProcessDialog.cpp index 8ae90be90..8413f5206 100644 --- a/src/BatchProcessDialog.cpp +++ b/src/BatchProcessDialog.cpp @@ -197,7 +197,6 @@ void BatchProcessDialog::OnApplyToProject(wxCommandEvent & WXUNUSED(event)) return; } - wxWindow * pWnd = this->GetParent(); #if !defined(__WXMAC__) // Under Linux an EndModal() here crashes (Bug #1221). // But sending a close message instead is OK. @@ -208,7 +207,9 @@ void BatchProcessDialog::OnApplyToProject(wxCommandEvent & WXUNUSED(event)) #else EndModal(wxID_OK); #endif - pWnd->SetFocus(); + + // Raise myself again, and the parent window with me + Show(); } void BatchProcessDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event)) @@ -368,7 +369,6 @@ void BatchProcessDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event)) } project->OnRemoveTracks(); - wxWindow * pWnd = this->GetParent(); // Under Linux an EndModal() here crashes (Bug #1221). // But sending a close message instead is OK. #if !defined(__WXMAC__) @@ -379,7 +379,9 @@ void BatchProcessDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event)) #else EndModal(wxID_OK); #endif - pWnd->SetFocus(); + + // Raise myself again, and the parent window with me + Show(); } void BatchProcessDialog::OnCancel(wxCommandEvent & WXUNUSED(event))