From 60c34d3ccb328894f5a8f9a4da014ee109b9a73b Mon Sep 17 00:00:00 2001 From: Anthony Nicholls Date: Mon, 6 Oct 2025 15:37:37 +0100 Subject: [PATCH] PopupMenu: Adjust the bounds of a menu that intersects with safe inset areas --- modules/juce_gui_basics/menus/juce_PopupMenu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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;