From 6fd0baa759145dde1fb6d609d1fc026bd31d9a4d Mon Sep 17 00:00:00 2001 From: reuk Date: Mon, 19 Oct 2020 17:36:51 +0100 Subject: [PATCH] FileChooser: Ensure macOS FileChooserComponent shows when FileChooser is reopened If the preview is not removed from the desktop, the FileChooser will try to reuse the same ComponentPeer the next time the preview component is used. --- modules/juce_gui_basics/native/juce_mac_FileChooser.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm index 14dd570518..7ca774711a 100644 --- a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm +++ b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm @@ -131,6 +131,10 @@ public: ~Native() override { exitModalState (0); + + if (preview != nullptr) + preview->removeFromDesktop(); + removeFromDesktop(); if (panel != nil)