Fixed some element types being spoken even though sound only is selected.

This commit is contained in:
Storm Dragon committed 2026-10-26 02:41:07 -04:00
1 parent 6ee0454fbe
commit 0d76e44f9a
5 files changed
+53 -6

No files matched your search

+4 -2
View File
@@ -127,7 +127,10 @@ func FocusSpeechWithOptions(snapshot atspi.Snapshot, options Options) Speech {
role = ""
}
_, replaceRole := roleSoundCue(snapshot, options)
if options.RoleSoundPresentation == "sound_only" && replaceRole {
_, replaceState := stateSoundCue(snapshot, options)
// A control-specific state cue also identifies its role. Keep the role
// spoken when role sounds are disabled or no replacement cue is available.
if options.RoleSoundPresentation == "sound_only" && (replaceRole || options.PlaySoundForRole && replaceState) {
role = ""
}
if options.SpeechVerbosityLevel != 0 && snapshot.ChildCountKnown && snapshot.ChildCount > 0 {
@@ -147,7 +150,6 @@ func FocusSpeechWithOptions(snapshot atspi.Snapshot, options Options) Speech {
}
fields = append(fields, snapshot.Name, role)
states := controlStates(snapshot)
_, replaceState := stateSoundCue(snapshot, options)
if options.RoleSoundPresentation == "sound_only" && replaceState {
states = removeReplacedState(states)
}