CallOutBox not displayed if the editor palette is disabled

Hello,

I’m trying to use a CallOutBox in a plug-in I made using the Magic GUI Plugin module.

I’m creating an item, use FOLEYS_DECLARE_GUI_FACTORY and then builder->registerFactory(…

I launch the CallOutBox from the mouseDown overridden method of my component like this:

        if (event.mods.isLeftButtonDown())
        {
            auto newEqPanel = std::make_unique<EqualizerPanel>();       
            newEqPanel->setSize (250, 500);
            newEqPanel->setKnobs(lowFreq, 0);
            newEqPanel->setKnobs(lowGain, 1);
            newEqPanel->setKnobs(midFreq, 2);
            newEqPanel->setKnobs(midGain, 3);
            newEqPanel->setKnobs(highFreq, 4);
            newEqPanel->setKnobs(highGain, 5);
            newEqPanel->setLookAndFeel(&m_Skeum);
            DBG("CALL_OUT_BOX");
            #if JUCE_VERSION > 0x60001
            juce::CallOutBox& coBox = juce::CallOutBox::launchAsynchronously (std::move(newEqPanel), getScreenBounds(), nullptr);
            coBox.setLookAndFeel(&m_Skeum);
            #else
            juce::CallOutBox& coBox = juce::CallOutBox::launchAsynchronously (newEqPanel.release(), getScreenBounds(), nullptr);
            coBox.setLookAndFeel(&m_Skeum);
            #endif
        }

It works perfectly if FOLEYS_SHOW_GUI_EDITOR_PALLETTE is enabled.
But as soon as FOLEYS_SHOW_GUI_EDITOR_PALLETTE is disabled the callout box
doesn’t appear.

The mouse event is called correctly (so clicking displays “CALL_OUT_BOX” in the console).
Is there something making the Call Out Boxes not displayed when the editor palette is disabled or something happening when it is enabled that makes the call out box working correctly that I would needed to do also on my side to ensure it works when it is disabled?

Oh wow, I am babboozled.
There is nothing intentional about that, and I have no idea what could have made it work in connection with the editor.

I would have to debug into it, sorry for not being more helpful. Let me know what you find, I am happy to help finding a fix.

Ok I just found the solution, it seems it comes from the JUCE_VERSION condition. By using the instructions corresponding to my juce version and then not use that ‘if’ condition the callout box appears correctly. I wonder why that work when the editor is opened since JUCE_VERSION is define in the juce_StandardHeader (so I don’t understand exactly what is happening)… but at least I get a solution :slightly_smiling_face: