Skip to content

Commit

Permalink
Send Accessibility Change Notifications (surge-synthesizer#5631)
Browse files Browse the repository at this point in the history
In a few strategic spots, if there's an accesibility handler
on the object, send accessibility notificatios for the object.

Addresses surge-synthesizer#4616
  • Loading branch information
baconpaul authored Dec 14, 2021
1 parent 18b1087 commit edd2344
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/surge-xt/gui/SurgeGUIEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1892,6 +1892,10 @@ void SurgeGUIEditor::openOrRecreateEditor()
patchSelector->grabKeyboardFocus();
}

if (auto *handler = frame->getAccessibilityHandler())
{
handler->notifyAccessibilityEvent(juce::AccessibilityEvent::structureChanged);
}
frame->repaint();
}

Expand Down Expand Up @@ -6279,6 +6283,16 @@ void SurgeGUIEditor::addComponentWithTracking(juce::Component *target, juce::Com
auto cf = containedComponents.find(&source);
if (cf != containedComponents.end())
containedComponents.erase(cf);

/* Place this accessibility invalidation here in either case */
if (auto *handler = source.getAccessibilityHandler())
{
if (handler->getValueInterface())
{
handler->notifyAccessibilityEvent(juce::AccessibilityEvent::valueChanged);
}
handler->notifyAccessibilityEvent(juce::AccessibilityEvent::titleChanged);
}
}
void SurgeGUIEditor::addAndMakeVisibleWithTracking(juce::Component *target, juce::Component &source)
{
Expand Down
5 changes: 5 additions & 0 deletions src/surge-xt/gui/widgets/WidgetBaseMixin.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ struct WidgetBaseMixin : public Surge::GUI::SkinConsumingComponent,
{
for (auto t : listeners)
t->valueChanged(this);

if (auto *handler = asT()->getAccessibilityHandler(); handler->getValueInterface())
{
handler->notifyAccessibilityEvent(juce::AccessibilityEvent::valueChanged);
}
}
void notifyControlModifierClicked(const juce::ModifierKeys &k, bool addRMB = false)
{
Expand Down

0 comments on commit edd2344

Please sign in to comment.