From be1d201035b91e8df99297b7f275e30de1e4e886 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 12 Nov 2021 13:34:49 +0000 Subject: [PATCH] One more macOS fix needed Signed-off-by: falkTX --- distrho/extra/FileBrowserDialog.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/distrho/extra/FileBrowserDialog.cpp b/distrho/extra/FileBrowserDialog.cpp index b26bde92..0bc93d1e 100644 --- a/distrho/extra/FileBrowserDialog.cpp +++ b/distrho/extra/FileBrowserDialog.cpp @@ -292,7 +292,7 @@ FileBrowserHandle fileBrowserCreate(const bool isEmbed, if (! options.saving) { - NSSavePanel* const nsOpenPanel = handle->nsOpenPanel; + NSOpenPanel* const nsOpenPanel = handle->nsOpenPanel; DISTRHO_SAFE_ASSERT_RETURN(nsOpenPanel != nullptr, nullptr); [nsOpenPanel setAllowsMultipleSelection:NO]; @@ -315,6 +315,8 @@ FileBrowserHandle fileBrowserCreate(const bool isEmbed, encoding:NSUTF8StringEncoding]; [nsBasePanel setTitle:titleString]; + FileBrowserData* const handleptr = handle.get(); + dispatch_async(dispatch_get_main_queue(), ^ { [nsBasePanel beginSheetModalForWindow:[(NSView*)windowId window] @@ -323,11 +325,11 @@ FileBrowserHandle fileBrowserCreate(const bool isEmbed, if (result == NSModalResponseOK && [[nsBasePanel URL] isFileURL]) { NSString* const path = [[nsBasePanel URL] path]; - handle->selectedFile = strdup([path UTF8String]); + handleptr->selectedFile = strdup([path UTF8String]); } else { - handle->selectedFile = kSelectedFileCancelled; + handleptr->selectedFile = kSelectedFileCancelled; } }]; });