Found more weird breakage on Slint. Fixed now.

This commit is contained in:
Storm Dragon committed 2026-11-02 17:28:31 +00:00
1 parent 6df27c88de
commit 7918fc02c4
14 files changed
+502 -6

No files matched your search

@@ -114,6 +114,12 @@ func (adapter *Adapter) captureNativeEventSnapshot(event *C.AtspiEvent, target *
captureCaret = role != C.ATSPI_ROLE_DOCUMENT_WEB && role != C.ATSPI_ROLE_DOCUMENT_FRAME && role != C.ATSPI_ROLE_EMBEDDED
}
snapshot := snapshotFromNativeWithCaret(target, captureCaret, eventType == CaretEvent, false, adapter.captureSound.Load(), adapter.captureTextAttributes.Load())
if eventType == CaretEvent {
if combo := C.cthulhu_read_only_combo(target); combo != nil {
snapshot.ReadOnlyCombo = nativeObjectID(combo)
C.g_object_unref(C.gpointer(combo))
}
}
if snapshot.Editable && (eventType == CaretEvent || eventType == TextInsertedEvent ||
eventType == TextDeletedEvent || eventType == TextSelectionChangedEvent) {
if editor := C.cthulhu_editable_root(target); editor != nil {
@@ -212,7 +218,10 @@ func (adapter *Adapter) captureNativeEventSnapshot(event *C.AtspiEvent, target *
}
}
if eventType == CaretEvent && snapshot.Role != "password text" {
// A read-only combo child only mirrors the chosen value. Qt 6.9 can stop
// answering accessibility requests after its word-at-caret query; no word
// feedback is needed for this non-writable selection proxy.
if eventType == CaretEvent && snapshot.Role != "password text" && !snapshot.ReadOnlyCombo.Valid() {
word := C.cthulhu_capture_caret_unit(target, C.ATSPI_TEXT_GRANULARITY_WORD)
snapshot.CaretWord = sanitizeSnapshotField(C.GoString(word))
C.g_free(C.gpointer(word))
@@ -559,7 +568,7 @@ func cthulhuAtspiEventCallback(event *C.AtspiEvent, userData unsafe.Pointer) {
focusEvent.Window = originID
}
if !focusEvent.ForegroundMismatch && !snapshot.Defunct && snapshot.Role != "invalid" {
if shouldRetainNativeFocus(eventType, focusEvent.Detail1, chromeFocus) &&
if shouldRetainNativeFocus(eventType, focusEvent.Detail1, chromeFocus) && !snapshot.ReadOnlyCombo.Valid() &&
!(eventType == SelectionChangedEvent && focusEvent.Source.LibreOffice != nil && focusEvent.Source.LibreOffice.InSpreadsheet) {
adapter.rememberNativeFocus(target, snapshot.ID())
}