patches: AnnouncementRequested PriorityMedium→High (interrupt buffer reading)

This commit is contained in:
2026-02-27 12:37:42 +01:00
parent 8a834448f9
commit 495a5510c6

View File

@@ -1,18 +1,12 @@
From c5c1040c973929ece99d40200fb47569d347a5af Mon Sep 17 00:00:00 2001
From 8cdd9866c92b756094dc56fec7560a9fc89cb29a Mon Sep 17 00:00:00 2001
From: Martin Sukany <martin@sukany.cz>
Date: Fri, 27 Feb 2026 12:27:09 +0100
Date: Fri, 27 Feb 2026 12:37:38 +0100
Subject: [PATCH] ns: implement VoiceOver accessibility (AXBoundsForRange, line
nav, completions, interactive spans)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* src/nsterm.m: Notification strategy: SelectedTextChanged only for
mark/selection changes; AnnouncementRequested only for cursor moves.
Eliminates double-speech systematically — VoiceOver cannot suppress
SelectedTextChanged speech even with High-priority announcements.
Character moves announce char AT point (evil block-cursor correct).
Line moves announce full line text or completion candidate.
AnnouncementRequested at PriorityHigh: immediately interrupts ongoing
VoiceOver speech (e.g. buffer reading) when user starts navigating.
Safe now that SelectedTextChanged is not posted for cursor moves.
---
src/nsterm.h | 109 ++
src/nsterm.m | 2733 +++++++++++++++++++++++++++++++++++++++++++++++---
@@ -153,7 +147,7 @@ index 7c1ee4c..6c95673 100644
diff --git a/src/nsterm.m b/src/nsterm.m
index 932d209..9ec2cfa 100644
index 932d209..bd1ab48 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -46,6 +46,7 @@ Updated by Christian Limpach (chris@nice.ch)
@@ -2033,7 +2027,7 @@ index 932d209..9ec2cfa 100644
+ NSDictionary *annInfo = @{
+ NSAccessibilityAnnouncementKey: ch,
+ NSAccessibilityPriorityKey:
+ @(NSAccessibilityPriorityMedium)
+ @(NSAccessibilityPriorityHigh)
+ };
+ NSAccessibilityPostNotificationWithUserInfo (
+ NSApp,
@@ -2086,7 +2080,7 @@ index 932d209..9ec2cfa 100644
+ NSDictionary *annInfo = @{
+ NSAccessibilityAnnouncementKey: announceText,
+ NSAccessibilityPriorityKey:
+ @(NSAccessibilityPriorityMedium)
+ @(NSAccessibilityPriorityHigh)
+ };
+ NSAccessibilityPostNotificationWithUserInfo (
+ NSApp,