diff --git a/modules/juce_gui_basics/menus/juce_PopupMenu.cpp b/modules/juce_gui_basics/menus/juce_PopupMenu.cpp index e2c8738799..2a357bd4fb 100644 --- a/modules/juce_gui_basics/menus/juce_PopupMenu.cpp +++ b/modules/juce_gui_basics/menus/juce_PopupMenu.cpp @@ -2017,6 +2017,17 @@ PopupMenu::Options PopupMenu::Options::withInitiallySelectedItem (int idOfItemTo Component* PopupMenu::createWindow (const Options& options, ApplicationCommandManager** managerOfChosenCommand) const { + #if JUCE_WINDOWS + const auto scope = [&]() -> std::unique_ptr + { + if (auto* target = options.getTargetComponent()) + if (auto* handle = target->getWindowHandle()) + return std::make_unique (handle); + + return nullptr; + }(); + #endif + return items.isEmpty() ? nullptr : new HelperClasses::MenuWindow (*this, nullptr, options, ! options.getTargetScreenArea().isEmpty(), diff --git a/modules/juce_gui_basics/misc/juce_DropShadower.cpp b/modules/juce_gui_basics/misc/juce_DropShadower.cpp index 45301ad3de..fe21871861 100644 --- a/modules/juce_gui_basics/misc/juce_DropShadower.cpp +++ b/modules/juce_gui_basics/misc/juce_DropShadower.cpp @@ -31,6 +31,17 @@ public: if (comp->isOnDesktop()) { + #if JUCE_WINDOWS + const auto scope = [&]() -> std::unique_ptr + { + if (comp != nullptr) + if (auto* handle = comp->getWindowHandle()) + return std::make_unique (handle); + + return nullptr; + }(); + #endif + setSize (1, 1); // to keep the OS happy by not having zero-size windows addToDesktop (ComponentPeer::windowIgnoresMouseClicks | ComponentPeer::windowIsTemporary