Browse Source

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.
v7.0.9
reuk 2 years ago
parent
commit
4ba81fda59
No known key found for this signature in database GPG Key ID: FCB43929F012EE5C
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      modules/juce_gui_basics/native/juce_FileChooser_windows.cpp

+ 2
- 0
modules/juce_gui_basics/native/juce_FileChooser_windows.cpp View File

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


Loading…
Cancel
Save