mirror of
https://github.com/cookiengineer/audacity
synced 2026-01-13 08:05:52 +01:00
Beat effects windows on the Mac into submission
This should resolve all concerns with the effects windows like:
1) Dropping behind the project window
2) Obscuring other dialogs
3) Keyboard cycling among the active windows
4) Clicking twice to do something in another window
NOTE: VST effects with a Cocoa overlay still require it.
Examples are Blue Cat and GRM.
This does tie an open effect to its parent project, but that should
be okay. We'll need to verify that again once we start to allow
multiple open effects dialogs at once.
This commit is contained in:
@@ -298,6 +298,18 @@ wxDialog *Effect::CreateUI(wxWindow *parent, EffectUIClientInterface *client)
|
||||
{
|
||||
EffectUIHost *dlg = new EffectUIHost(parent, this, client);
|
||||
|
||||
#if defined(__WXMAC__)
|
||||
// We want the effects windows on the Mac to float above the project window
|
||||
// but still have normal modal dialogs appear above the effects windows and
|
||||
// not let the effect windows fall behind the project window.
|
||||
//
|
||||
// This seems to accomplish that, but time will be the real judge.
|
||||
WindowRef windowRef = (WindowRef) dlg->MacGetWindowRef();
|
||||
WindowGroupRef parentGroup = GetWindowGroup((WindowRef) ((wxFrame *)wxGetTopLevelParent(parent))->MacGetWindowRef());
|
||||
ChangeWindowGroupAttributes(parentGroup, kWindowGroupAttrSharedActivation, kWindowGroupAttrMoveTogether);
|
||||
SetWindowGroup(windowRef, parentGroup);
|
||||
#endif
|
||||
|
||||
if (dlg->Initialize())
|
||||
{
|
||||
return dlg;
|
||||
@@ -2268,10 +2280,6 @@ void EffectUIHost::OnSaveAs(wxCommandEvent & WXUNUSED(evt))
|
||||
wxString name;
|
||||
wxDialog dlg(this, wxID_ANY, wxString(_("Save Preset")));
|
||||
|
||||
#if defined(EXPERIMENTAL_REALTIME_EFFECTS) && defined(__WXMAC__)
|
||||
HIWindowChangeClass((WindowRef) dlg.MacGetWindowRef(), kMovableModalWindowClass);
|
||||
#endif
|
||||
|
||||
ShuttleGui S(&dlg, eIsCreating);
|
||||
|
||||
S.StartPanel();
|
||||
|
||||
@@ -639,10 +639,6 @@ END_EVENT_TABLE()
|
||||
VSTEffectSettingsDialog::VSTEffectSettingsDialog(wxWindow * parent, EffectHostInterface *host)
|
||||
: wxDialog(parent, wxID_ANY, wxString(_("VST Effect Settings")))
|
||||
{
|
||||
#if defined(EXPERIMENTAL_REALTIME_EFFECTS) && defined(__WXMAC__)
|
||||
HIWindowChangeClass((WindowRef) MacGetWindowRef(), kMovableModalWindowClass);
|
||||
#endif
|
||||
|
||||
mHost = host;
|
||||
|
||||
mHost->GetSharedConfig(wxT("Settings"), wxT("BufferSize"), mBufferSize, 8192);
|
||||
@@ -2065,12 +2061,6 @@ bool VSTEffect::PopulateUI(wxWindow *parent)
|
||||
mEventHelper = new VSTEffectEventHelper(this);
|
||||
mParent->PushEventHandler(mEventHelper);
|
||||
|
||||
#if defined(__WXMAC__)
|
||||
#if defined(EXPERIMENTAL_REALTIME_EFFECTS)
|
||||
HIWindowChangeClass((WindowRef) mDialog->MacGetWindowRef(), kFloatingWindowClass);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Determine if the VST editor is supposed to be used or not
|
||||
mHost->GetSharedConfig(wxT("Settings"),
|
||||
wxT("UseGUI"),
|
||||
|
||||
@@ -306,10 +306,6 @@ END_EVENT_TABLE()
|
||||
AudioUnitEffectSettingsDialog::AudioUnitEffectSettingsDialog(wxWindow * parent, EffectHostInterface *host)
|
||||
: wxDialog(parent, wxID_ANY, wxString(_("AudioUnit Effect Settings")))
|
||||
{
|
||||
#if defined(EXPERIMENTAL_REALTIME_EFFECTS) && defined(__WXMAC__)
|
||||
HIWindowChangeClass((WindowRef) MacGetWindowRef(), kMovableModalWindowClass);
|
||||
#endif
|
||||
|
||||
mHost = host;
|
||||
|
||||
mHost->GetSharedConfig(wxT("Settings"), wxT("UseBufferDelay"), mUseBufferDelay, true);
|
||||
@@ -421,8 +417,6 @@ END_EVENT_TABLE()
|
||||
AudioUnitEffectExportDialog::AudioUnitEffectExportDialog(wxWindow * parent, AudioUnitEffect *effect)
|
||||
: wxDialog(parent, wxID_ANY, wxString(_("Export AudioUnit Presets")))
|
||||
{
|
||||
HIWindowChangeClass((WindowRef) MacGetWindowRef(), kMovableModalWindowClass);
|
||||
|
||||
mEffect = effect;
|
||||
|
||||
ShuttleGui S(this, eIsCreating);
|
||||
@@ -590,8 +584,6 @@ END_EVENT_TABLE()
|
||||
AudioUnitEffectImportDialog::AudioUnitEffectImportDialog(wxWindow * parent, AudioUnitEffect *effect)
|
||||
: wxDialog(parent, wxID_ANY, wxString(_("Import AudioUnit Presets")))
|
||||
{
|
||||
HIWindowChangeClass((WindowRef) MacGetWindowRef(), kMovableModalWindowClass);
|
||||
|
||||
mEffect = effect;
|
||||
|
||||
ShuttleGui S(this, eIsCreating);
|
||||
@@ -1788,8 +1780,6 @@ bool AudioUnitEffect::PopulateUI(wxWindow *parent)
|
||||
mDialog = (wxDialog *) wxGetTopLevelParent(parent);
|
||||
mParent = parent;
|
||||
|
||||
HIWindowChangeClass((WindowRef) mDialog->MacGetWindowRef(), kFloatingWindowClass);
|
||||
|
||||
WindowRef windowRef = (WindowRef) mDialog->MacGetWindowRef();
|
||||
ControlRef rootControl = HIViewGetRoot(windowRef);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user