Some echo tests added.

This commit is contained in:
Storm Dragon committed 2026-10-27 00:40:49 -04:00
1 parent 8a32895457
commit eb5b2038d6
38 files changed
+1739 -31

No files matched your search

@@ -433,6 +433,17 @@ func cthulhuAtspiEventCallback(event *C.AtspiEvent, userData unsafe.Pointer) {
adapter.forgetWindowDocuments(originID)
}
invalidated := adapter.applyTreeInvalidation(eventType, event)
if eventType == DefunctStateEvent && C.cthulhu_event_detail1(event) != 0 &&
adapter.applicationProcesses[originID.BusName] == "pidgin" {
// Read-only transcripts need not own native focus. Forward their
// retirement before the ordinary dead-object early return, without
// querying a destroyed accessible or broadening focus ownership.
retired := NewEvent(eventType, Snapshot{BusName: originID.BusName, Path: originID.Path,
ApplicationProcess: "pidgin", Defunct: true})
retired.Detail1 = 1
adapter.enqueueSecureEvent(retired, secureEpoch)
return
}
if eventType == DefunctStateEvent && C.cthulhu_event_detail1(event) != 0 && adapter.webNotificationRoots[originID] {
delete(adapter.webNotificationRoots, originID)
// Retire a known toast before the normal dead-object early return.
@@ -446,6 +457,17 @@ func cthulhuAtspiEventCallback(event *C.AtspiEvent, userData unsafe.Pointer) {
// notification script needs their semantics before that early return,
// including when the provider is outside foreground ownership.
webNotification := adapter.webNotification(event)
if message := adapter.pidginMessage(event); message != nil {
// A transcript insertion is a passive announcement. Keep it out of
// native focus capture, selected-descendant resolution and review.
chatEvent := NewEvent(TextInsertedEvent, Snapshot{BusName: message.Provider,
Path: message.Conversation, Role: "text", ApplicationProcess: "pidgin"})
chatEvent.ChatMessage = message
chatEvent.Window = NewObjectID(message.Provider, message.Window)
chatEvent.Foreground = adapter.Foreground()
adapter.enqueueSecureEvent(chatEvent, secureEpoch)
return
}
if invalidated && webNotification == nil && eventType != ChildrenAddedEvent && (eventType != DefunctStateEvent || !adapter.nativeFocusIs(originID)) {
return
}