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 edb3a37f853fc9b98dfc96a7ba0434e87e1fdc3e Mon Sep 17 00:00:00 2001
From a92cfbac382d563f5d54fac32fab1711414574bb Mon Sep 17 00:00:00 2001
From: Martin Sukany <martin@sukany.cz>
Date: Sat, 28 Feb 2026 22:39:35 +0100
Subject: [PATCH 0/8] ns: integrate with macOS Zoom for cursor tracking
@@ -32,7 +32,7 @@ to the selected completion candidate after normal cursor tracking.
3 files changed, 370 insertions(+)
diff --git a/etc/NEWS b/etc/NEWS
index ef36df5..80661a9 100644
index 7367e3ccbd..4c149e41d6 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -82,6 +82,17 @@ other directory on your system. You can also invoke the
@@ -54,7 +54,7 @@ index ef36df5..80661a9 100644
** 'line-spacing' now supports specifying spacing above the line.
Previously, only spacing below the line could be specified. The user
diff --git a/src/nsterm.h b/src/nsterm.h
index 7c1ee4c..ea6e7ba 100644
index 7c1ee4cf53..ea6e7ba4f5 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -484,6 +484,12 @@ enum ns_return_frame_mode
@@ -71,7 +71,7 @@ index 7c1ee4c..ea6e7ba 100644
}
diff --git a/src/nsterm.m b/src/nsterm.m
index 74e4ad5..fc75910 100644
index 932d209f56..417c312a88 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -71,6 +71,11 @@ Updated by Christian Limpach (chris@nice.ch)