1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

FileChooser: Fix bug where native FileChooser could not be closed when hosted in Cantabile

Previously, the top-level modal dismiss broadcaster would attempt to
dismiss all modals when the native file chooser was brought to the front
or clicked. This would end up calling Component::inputAttemptWhenModal,
which would bring the FileChooser's Component to the front, interrupting
the mouse click.

The fix is to avoid bringing the plugin window to the front when the
FileChooser is in a modal state. As the chooser is a native window, the
system should take care of enforcing the expected modal behaviour.

It's not clear why this issue only affects Cantabile. It seems that in
Cantabile, events from the native FileChooser get sent to the plugin
editor's parent HWND, whereas this doesn't happen in other hosts.
Perhaps Cantabile is hooking/intercepting window messages in some way.
This commit is contained in:
reuk 2023-05-24 11:49:10 +01:00
parent 910c60b84a
commit 4ba81fda59
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C

View file

@ -876,6 +876,8 @@ public:
return targetComponent->findParentComponentOfClass<FilePreviewComponent>() != nullptr;
}
void inputAttemptWhenModal() override {}
private:
FileChooser& owner;
std::shared_ptr<Win32NativeFileChooser> nativeFileChooser;