Messages read as you tab through discord again.

This commit is contained in:
lilmike committed 2026-11-01 14:52:44 -08:00
1 parent 6ed0e36960
commit 9374b5a2e5
10 files changed
+162 -3

No files matched your search

+15 -1
View File
@@ -220,8 +220,22 @@ func (presenter *eventPresenter) speak(event atspi.Event, capturedIntent ...inpu
line = &speechLine{Object: event.Source.ID(), Raw: event.Source.BrailleLine}
}
browseContext := browser.speech_context_enabled() && event.Source.BusName == browser.document.BusName
context := event.Source.SpeechContext
if !browseContext && isFocusGainEvent(event) {
// Named articles label a focused descendant even in focus mode (for
// example, a chat message's Reply button), including while browser
// context discovery is pending. Other container context retains its
// browse-mode policy.
context = nil
for _, ancestor := range event.Source.SpeechContext {
if ancestor.Role == "article" && ancestor.Name != "" {
context = append(context, ancestor)
}
}
browseContext = len(context) != 0
}
speech.Enqueue(speechRequest{
Context: event.Source.SpeechContext, ResetContext: !browseContext, VoiceType: ancestor_voice(event.Source.SpeechContext),
Context: context, ResetContext: !browseContext, VoiceType: ancestor_voice(event.Source.SpeechContext),
Window: eventWindow(event),
IntroducesWindow: (event.Type == atspi.WindowActivatedEvent || event.Type == atspi.WindowCreateEvent) &&
activationTitle(event) != "",