popupMenu lnf breaking change

This change has broken my menus lnf :

When a popup menu has a parent component, it used to be painted with that parent’s lnf.
It is now painted with the default lnf.

below is a pip to reproduce and 2 pics showing the issue.

PIP CODE
/*******************************************************************************
 The block below describes the properties of this PIP. A PIP is a short snippet
 of code that can be read by the Projucer and used to generate a JUCE project.

 BEGIN_JUCE_PIP_METADATA

  name:             MenuLnfTest

  dependencies:     juce_core, juce_data_structures, juce_events, juce_graphics, juce_gui_basics
  exporters:        XCODE_MAC

  moduleFlags:      JUCE_STRICT_REFCOUNTEDPOINTER=1

  type:             Component
  mainClass:        MyComponent

 END_JUCE_PIP_METADATA

*******************************************************************************/

#pragma once


//==============================================================================
class MyComponent  : public juce::Component
{
public:
    //==============================================================================
    MyComponent()
    {
        LookAndFeel::setDefaultLookAndFeel (&lookAndFeel_V1);
        setLookAndFeel (&lookAndFeel_V4);

        addAndMakeVisible (menuButton);
        menuButton.onClick = [&]
        {
            PopupMenu menu;

            for (int i = 0; i < 10; ++i)
                menu.addItem ("Item " + String (i), nullptr);

            menu.showMenuAsync (PopupMenu::Options{}.withParentComponent (this));
        };

        setSize (600, 400);
    }

    //==============================================================================
    void paint (juce::Graphics& g) override
    {
        g.fillAll (Colours::grey);
    }

    void resized() override
    {
        menuButton.setBounds (10, 10, 200, 40);
    }


private:
    //==============================================================================
    LookAndFeel_V1 lookAndFeel_V1;
    LookAndFeel_V4 lookAndFeel_V4;
    TextButton menuButton { "open menu" };

    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MyComponent)
};

7.0.4 has been released since I’ve report this.
Can you add this in BREAKING-CHANGES.txt ?
Do you plan to get this fix for 7.0.5, or will it stay like that?

a gentle bump in case you missed this, as popup menus lnf are broken in both master and develop atm.
any chance this could this get fix for 7.0.5?

We’ve got a fix on the way for this.

2 Likes

Thanks for reporting. That’s fixed on develop: