ax: fix VoiceOver cursor sync and word double-read

Bug 1 (VO cursor not following Emacs cursor):
- Remove FocusedUIElementChangedNotification on emacsView (was a no-op:
  VO re-queried the same element)
- For Emacs-initiated char/word moves, keep natural next/previous
  direction instead of forcing discontiguous; SelectedTextChanged with
  direction=next advances VO browse cursor sequentially
- Only force discontiguous for line-boundary crossings and large jumps

Bug 2 (word double-read with punctuation):
- Root cause was FocusedUIElementChanged causing VO re-anchor speech
  on top of the explicit word announcement
- Removing FocusedUIElementChanged eliminates the duplicate speech
- Add emacsInitiated parameter to postFocusedCursorNotification;
  omit AXTextSelectionGranularity for Emacs-initiated moves so VO
  does not auto-speak (only explicit announcements provide speech)
- isWordMove now triggers on emacsInitiated flag (Emacs-initiated
  word moves always get explicit announcement)
This commit is contained in:
2026-03-02 12:38:40 +01:00
parent 53ea58725e
commit bc5714b7b7
9 changed files with 124 additions and 118 deletions

View File

@@ -1,4 +1,4 @@
From 1ce902a7a0b0d4d63e9d9f8718145d183a3c5d1a Mon Sep 17 00:00:00 2001
From e2e327e374445912764bf3efb4dd65af9a238a41 Mon Sep 17 00:00:00 2001
From: Martin Sukany <martin@sukany.cz>
Date: Sat, 28 Feb 2026 12:58:11 +0100
Subject: [PATCH 4/8] ns: add interactive span elements for Tab navigation
@@ -18,10 +18,10 @@ rebuilding lazily when interactiveSpansDirty is set.
1 file changed, 287 insertions(+)
diff --git a/src/nsterm.m b/src/nsterm.m
index d3015e2..6d3b87a 100644
index 221697b78a..70ec4286bf 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -9304,6 +9304,293 @@ - (NSRect)accessibilityFrame
@@ -9342,6 +9342,293 @@ - (NSRect)accessibilityFrame
@end