From 24f11dcbc071644275689ddc291324e22b0965ec Mon Sep 17 00:00:00 2001 From: "v.audacity" Date: Wed, 15 Feb 2012 01:15:51 +0000 Subject: [PATCH] Apply Leland's *other* patch for bug 344 (p3). --- src/widgets/ProgressDialog.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/widgets/ProgressDialog.cpp b/src/widgets/ProgressDialog.cpp index 570e7d6f0..f915fc6d8 100644 --- a/src/widgets/ProgressDialog.cpp +++ b/src/widgets/ProgressDialog.cpp @@ -1272,6 +1272,21 @@ ProgressDialog::Show(bool show) if (!mDisable) { mDisable = new wxWindowDisabler(this); + + #if defined(__WXMAC__) + // LL: On the Mac, the parent windows get disabled, but they still respond + // to the close button being clicked and the application quit menu item + // is still enabled. We do not want the parent window to be destroyed + // while we're active, so we have to kludge around a bit to keep this + // from happening. + WindowRef windowRef = (WindowRef) MacGetWindowRef(); + SetWindowModality( windowRef, kWindowModalityAppModal, NULL ) ; + BeginAppModalStateForWindow(windowRef); + + wxMenuBar *bar = wxStaticCast(wxGetTopLevelParent(wxTheApp->GetTopWindow()), wxFrame)->GetMenuBar(); + bar->Enable(wxID_PREFERENCES, false); + bar->Enable(wxID_EXIT, false); + #endif } }