diff --git a/modules/juce_gui_basics/menus/juce_PopupMenu.cpp b/modules/juce_gui_basics/menus/juce_PopupMenu.cpp index 12efb29c3a..ad68b16249 100644 --- a/modules/juce_gui_basics/menus/juce_PopupMenu.cpp +++ b/modules/juce_gui_basics/menus/juce_PopupMenu.cpp @@ -373,13 +373,13 @@ struct MenuWindow final : public Component } else { - const auto shouldDisableAccessibility = [this] + const auto shouldDisableAccessibility = std::invoke ([this] { const auto* compToCheck = parent != nullptr ? parent : options.getTargetComponent(); return compToCheck != nullptr && ! compToCheck->isAccessible(); - }(); + }); if (shouldDisableAccessibility) setAccessible (false); @@ -874,7 +874,7 @@ struct MenuWindow final : public Component auto parentArea = getParentArea (target.getCentre()) / scaleFactor; if (auto* pc = options.getParentComponent()) - target = pc->getLocalArea (nullptr, target).getIntersection (parentArea); + target = pc->getLocalArea (nullptr, target).constrainedWithin (parentArea); auto maxMenuHeight = parentArea.getHeight() - 24;