Skip to content

Commit

Permalink
fix #306633: Always update status bar text
Browse files Browse the repository at this point in the history
Fixes regression caused by commit 3960396 in PR #6173.

The accessibleMessage string is cleared in the function
AccessibleScoreView::text(), but that function only gets called if
there is a screen reader running. If there is no screen reader then
accessibleMessage would never be emptied after it was first set, hence
currentInfoChanged() was never called to set the status bar text.
  • Loading branch information
shoogle committed Jun 17, 2020
1 parent 1a9b942 commit 20b6262
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mscore/scoreaccessibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,16 +352,19 @@ void ScoreAccessibility::updateAccessibilityInfo()
if (!w)
return;

if (w->score()->accessibleMessage().isEmpty())
currentInfoChanged();
currentInfoChanged();

// Try to send message to the screen reader. Note that NVDA will
// ignore the message if it is the same as the previous message.
updateAccessibility();

#if defined(Q_OS_WIN)
// HACK: send the message again after a short delay to force NVDA
// to read it even if it is the same as before.
// to read it even if it is the same as before. This is useful when
// cursoring through a word with repeated characters, such as "food".
// Without this hack NVDA would say "f", "o", *silence*, "d".
QTimer::singleShot(0, this, &ScoreAccessibility::updateAccessibility);
#endif
}

void ScoreAccessibility::updateAccessibility()
Expand Down

0 comments on commit 20b6262

Please sign in to comment.