From f762fba599fd8463de7f692074661b3edeb3f618 Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 9 Apr 2023 08:44:55 -0400 Subject: [PATCH] Scope RMB on Trigger Type resets value (#6921) Make sure to send value changed to the correct boject. Addresses #6778 --- src/surge-xt/gui/overlays/Oscilloscope.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/surge-xt/gui/overlays/Oscilloscope.cpp b/src/surge-xt/gui/overlays/Oscilloscope.cpp index 632181ba613..195434882c2 100644 --- a/src/surge-xt/gui/overlays/Oscilloscope.cpp +++ b/src/surge-xt/gui/overlays/Oscilloscope.cpp @@ -717,7 +717,14 @@ int32_t Oscilloscope::controlModifierClicked(Surge::GUI::IComponentTagValue *pCo contextMenu.addItem(op.first, true, (val == pControl->getValue()), [val, pControl, this]() { pControl->setValue(val); - valueChanged(pControl); + + // The switch button is self-draw and has its own value change + // so we need to handle that eventuality here + auto sc = dynamic_cast(pControl); + if (sc) + sc->valueChanged(pControl); + else + valueChanged(pControl); auto iv = pControl->asJuceComponent();