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

PopupMenu: Avoid dismissing PopupMenus in bridged plugin editors

When bridging 32-bit/64-bit plugins on Windows, the plugin is hosted in
an auxilliary process, and the plugin's editor is embedded into an HWND
owned by a different process (the plugin host).

Previously, the `isForegroundProcess` check would fail for bridged
plugins, because the foreground window may belong to the DAW, rather
than to the auxilliary hosting process.

This patch adds an additional check, to find whether the same process
owns both the foreground window, and the window which embeds the
PopupMenu's target component. In this case, we avoid immediately
dismissing the PopupMenu.
This commit is contained in:
reuk 2021-06-07 20:02:12 +01:00
parent 550127945d
commit 1ee106d730
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11
7 changed files with 52 additions and 15 deletions

View file

@ -605,7 +605,7 @@ void FileBrowserComponent::getRoots (StringArray& rootNames, StringArray& rootPa
void FileBrowserComponent::timerCallback()
{
const bool isProcessActive = Process::isForegroundProcess();
const auto isProcessActive = isForegroundOrEmbeddedProcess (this);
if (wasProcessActive != isProcessActive)
{