Redundant buttonClicked calls due to Button::CallbackHelper::valueChanged

gui

#1

Hi,
In my plugin, I use Value::referTo to bind some of my AudioProcessor’s values to toggle buttons.
But I found there were some redundant calls from the GUI during the preset restoration.
This operation was triggering some buttonClicked callback without any user action.
This is due to Button::CallbackHelper::valueChanged in juce_Button.cpp.
Line 46 of this file, Button::setToggleState is called with a sendNotification parameter which calls sendClickMessage later.
Here is part of the call stack:
24
So Is the Value::referTo supposed to be used this way?
Is the sendNotification in Button::CallbackHelper normal?
Thanks!


#2

Hmm, good point, it does look like it should be using dontSendNotification in the callback helper - thanks, I’ll change that!