diff --git a/src/widgets/FileDialog/mac/FileDialogPrivate.mm b/src/widgets/FileDialog/mac/FileDialogPrivate.mm index d451f8554..ff1443505 100644 --- a/src/widgets/FileDialog/mac/FileDialogPrivate.mm +++ b/src/widgets/FileDialog/mac/FileDialogPrivate.mm @@ -367,6 +367,19 @@ void FileDialog::SetupExtraControls(WXWindow nativeWindow) { wxBoxSizer *verticalSizer = new wxBoxSizer( wxVERTICAL ); + // FINALLY FOUND IT! Creating the panel with "this" as the parent causes + // an exception and stack trace to be printed to stderr: + // + // 2021-02-17 13:52:14.550 Audacity[69217:891282] warning: ignoring attempt to mutate its subviews ( + // 0 ViewBridge 0x00007fff6596685d -[NSRemoteView _announceSubviewMutationDisallowed] + 29 + // 1 libwx_osx_cocoau_debug_core-3.1.3.0 0x0000000111c3abf1 _ZN17wxWidgetCocoaImpl5EmbedEP12wxWidgetImpl + 177 + // + // It's because wxPanel tries to embed the wxPanel into the NSSavePanel and + // that's not allowed. Everything still works fine, so it can be ignored. + // But, if you want to dig into it further, changing the "this" parent to + // GetParent() gets rid of the exception. However, events from the extra + // controls in the accessory view do not get handled correctly. + m_filterPanel = new wxPanel( this, wxID_ANY ); accView = m_filterPanel->GetHandle();