CallOutBox resized the whole plugin (VST only)


#1

Hi all,

I prefer to not create any additional window from within a plugin.
That's why I would like a CallOutBox to be draw onto the AudioProcessorEditor using

CallOutBox::launchAsynchronously (colourSelector, targetBoundsRelativeToTopLevelComp, getTopLevelComponent());

This works as expected when I run the plugin as AU, AAX or in a StandaloneFilterWindow i.e. as a standalone application.

But if executed as a VST plugin (on OSX 10.11) the plugin editor will resize to the size of the CallOutBox as soon as the CallOutBox gets constructed. Here's the reason why:

#0    0x000000011ddf0822 in LUFSMeterAudioProcessorEditor::resized() at /Users/sam/data/docs/projects_dev/LUFSMeter/projects/LUFSMeter/Source/LUFSMeterAudioProcessorEditor.cpp:787
#1    0x000000011e0861c4 in juce::Component::sendMovedResizedMessages(bool, bool) at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_gui_basics/components/juce_Component.cpp:1183
#2    0x000000011e086105 in juce::Component::sendMovedResizedMessagesIfPending() at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_gui_basics/components/juce_Component.cpp:1165
#3    0x000000011e086070 in juce::Component::setBounds(int, int, int, int) at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_gui_basics/components/juce_Component.cpp:1151
#4    0x000000011e0864cd in juce::Component::setBounds(juce::Rectangle<int> const&) at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_gui_basics/components/juce_Component.cpp:1229
#5    0x000000011e247f9c in JuceVSTWrapper::EditorCompWrapper::resized() at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp:1443
#6    0x000000011e0861c4 in juce::Component::sendMovedResizedMessages(bool, bool) at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_gui_basics/components/juce_Component.cpp:1183
#7    0x000000011e086105 in juce::Component::sendMovedResizedMessagesIfPending() at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_gui_basics/components/juce_Component.cpp:1165
#8    0x000000011e086070 in juce::Component::setBounds(int, int, int, int) at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_gui_basics/components/juce_Component.cpp:1151
#9    0x000000011e0863c0 in juce::Component::setSize(int, int) at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_gui_basics/components/juce_Component.cpp:1209
#10    0x000000011e248097 in JuceVSTWrapper::EditorCompWrapper::childBoundsChanged(juce::Component*) at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp:1468
#11    0x000000011e0862d0 in juce::Component::sendMovedResizedMessages(bool, bool) at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_gui_basics/components/juce_Component.cpp:1200
#12    0x000000011e086105 in juce::Component::sendMovedResizedMessagesIfPending() at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_gui_basics/components/juce_Component.cpp:1165
#13    0x000000011e086070 in juce::Component::setBounds(int, int, int, int) at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_gui_basics/components/juce_Component.cpp:1151
#14    0x000000011e08641c in juce::Component::setTopLeftPosition(int, int) at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_gui_basics/components/juce_Component.cpp:1214
#15    0x000000011e24801b in JuceVSTWrapper::EditorCompWrapper::childBoundsChanged(juce::Component*) at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp:1455
#16    0x000000011e0862d0 in juce::Component::sendMovedResizedMessages(bool, bool) at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_gui_basics/components/juce_Component.cpp:1200
#17    0x000000011e086105 in juce::Component::sendMovedResizedMessagesIfPending() at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_gui_basics/components/juce_Component.cpp:1165
#18    0x000000011e086070 in juce::Component::setBounds(int, int, int, int) at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_gui_basics/components/juce_Component.cpp:1151
#19    0x000000011e0864cd in juce::Component::setBounds(juce::Rectangle<int> const&) at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_gui_basics/components/juce_Component.cpp:1229
#20    0x000000011e12fd12 in juce::CallOutBox::updatePosition(juce::Rectangle<int> const&, juce::Rectangle<int> const&) at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_gui_basics/windows/juce_CallOutBox.cpp:227
#21    0x000000011e12f35f in juce::CallOutBox::CallOutBox(juce::Component&, juce::Rectangle<int> const&, juce::Component*) at /Users/sam/data/docs/projects_dev/LUFSMeter/libraries/juce/modules/juce_gui_basics/windows/juce_CallOutBox.cpp:33

Is this behaviour to be expected and is it terribly wrong to use CallOutBox::launchAsynchronously() in this context?

Btw: DialogWindow has the exact same effect in a VST plugin.

 


#2

CallOutBox Issue 2

When

CallOutBox::launchAsynchronously (colourSelector, targetBoundsRelativeToTopLevelComp, getTopLevelComponent());

is used in a standalone version of a plugin (StandaloneFilterWindow), the CallOutBox gets added to the ResizableWindow. -> EXC_BAD_ACCESS if the CallOutBox is open and the application gets terminated.

 

CallOutBox Issue 3

In a regular standalone application, CallOutBox::launchAsynchronously (.., .., nullptr) opens the CallOutBox BEHIND the current window if it is called in mouseUp(). Until recently ( before the JUCE 4 release) the CallOutBox got displayed in front of the current window. In my specific use case there are "colour squares" allowing the user to set the colours of different UI elements via a ColourSelector in a CallOutBox. The user can also drag and drop the "colour squares" to copy colours around. That's why the CallOutBox is launched in mouseUp() instead of mouseDown().

If the CallOutBox::launchAsynchronously (.., .., nullptr) gets called in mouseDown(), the CallOutBox is in front of the current window, as expected.


#3

By calling getTopLevelComponent(), you'll be unwittingly getting hold of an internal VST component that you should never go near. Instead, add it to your editor component, bearing in mind that your editor could be embedded inside any number of other random parent components.


#4

Thank you Jules for your explanation!

CallOutBox Issue 3

In a regular standalone application, CallOutBox::launchAsynchronously (.., .., nullptr) opens the CallOutBox BEHIND the current window if it is called in mouseUp(). Until recently ( before the JUCE 4 release) the CallOutBox got displayed in front of the current window. In my specific use case there are "colour squares" allowing the user to set the colours of different UI elements via a ColourSelector in a CallOutBox. The user can also drag and drop the "colour squares" to copy colours around. That's why the CallOutBox is launched in mouseUp() instead of mouseDown().

If the CallOutBox::launchAsynchronously (.., .., nullptr) gets called in mouseDown(), the CallOutBox is in front of the current window, as expected.

This does not happen on Windows. It's probably an issue introduced with OS X 10.11 (and not with JUCE 4).

Has anyone an elegant solution for this one?