patches: address maintainer review findings (C1/C2/H1/H2/M5/M6)

C1 - block_input ordering in ns_ax_buffer_text:
block_input() now called before record_unwind_protect_void(unblock_input).
Previously the unwind handler could have been called without a matching
block_input, corrupting the input-blocking reference count.

C2 - unbind_to missing in patch 0004:
unbind_to(blk_count, Qnil) moved from patch 0008 to patch 0004 so that
ns_ax_scan_interactive_spans has a complete block_input/unbind_to pair
when patches 0000-0004 are applied independently.

H1 - Zoom patch forward dependency on VoiceOver:
Removed forward declaration 'static bool ns_ax_face_is_selected' and
the delegation from ns_zoom_face_is_selected.  Restored standalone
implementation of ns_zoom_face_is_selected in the Zoom patch so patch
0000 compiles and links independently of the VoiceOver patches.

H2 - ns_accessibility_enabled removal undocumented:
Added comment to ns_zoom_track_completion explaining that Zoom cursor
tracking is gated only on ns_zoom_enabled_p(), not ns_accessibility_enabled.
Users running Zoom without VoiceOver must still get completion tracking.

M5 - childFrameLastBuffer GC safety undocumented:
Added comment at the assignment site explaining why BVAR(b, name) (an
interned symbol reachable from obarray) is GC-safe without staticpro.

M6 - FOR_EACH_FRAME without block_input:
Added block_input/unblock_input around the FOR_EACH_FRAME loop in
postAccessibilityUpdates that checks for visible child frames.
Vframe_list must not be modified by timers or process sentinels
during iteration.
This commit is contained in:
2026-03-03 10:11:39 +01:00
parent 73563be72d
commit 3bb6c989c9
9 changed files with 80 additions and 91 deletions

View File

@@ -1,4 +1,4 @@
From 6b9c326c56346bc55381d4d5c68cd34b59165417 Mon Sep 17 00:00:00 2001
From b6f4bb85d337a22bd6e761181aa0f192d5d078f8 Mon Sep 17 00:00:00 2001
From: Daneel <daneel@sukany.cz>
Date: Mon, 2 Mar 2026 18:39:46 +0100
Subject: [PATCH 7/8] ns: announce overlay completion candidates for VoiceOver
@@ -34,7 +34,7 @@ index 5746e9e9bd..21a93bc799 100644
@property (nonatomic, assign) BOOL cachedMarkActive;
@property (nonatomic, copy) NSString *cachedCompletionAnnouncement;
diff --git a/src/nsterm.m b/src/nsterm.m
index a0598a73c2..8f744d1bf3 100644
index 8e5cc7e1d7..8ef344d9fe 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7263,11 +7263,154 @@ Accessibility virtual elements (macOS / Cocoa only)
@@ -508,7 +508,7 @@ index a0598a73c2..8f744d1bf3 100644
{
ptrdiff_t oldPoint = self.cachedPoint;
BOOL oldMarkActive = self.cachedMarkActive;
@@ -12402,7 +12666,7 @@ - (int) fullscreenState
@@ -12403,7 +12667,7 @@ - (int) fullscreenState
if (WINDOW_LEAF_P (w))
{
@@ -517,7 +517,7 @@ index a0598a73c2..8f744d1bf3 100644
EmacsAccessibilityBuffer *elem
= [existing objectForKey:[NSValue valueWithPointer:w]];
if (!elem)
@@ -12436,7 +12700,7 @@ - (int) fullscreenState
@@ -12437,7 +12701,7 @@ - (int) fullscreenState
}
else
{
@@ -526,7 +526,7 @@ index a0598a73c2..8f744d1bf3 100644
Lisp_Object child = w->contents;
while (!NILP (child))
{
@@ -12548,7 +12812,7 @@ - (void)postAccessibilityUpdates
@@ -12549,7 +12813,7 @@ - (void)postAccessibilityUpdates
accessibilityUpdating = YES;
/* Detect window tree change (split, delete, new buffer). Compare
@@ -535,7 +535,7 @@ index a0598a73c2..8f744d1bf3 100644
Lisp_Object curRoot = FRAME_ROOT_WINDOW (emacsframe);
if (!EQ (curRoot, lastRootWindow))
{
@@ -12557,12 +12821,12 @@ - (void)postAccessibilityUpdates
@@ -12558,12 +12822,12 @@ - (void)postAccessibilityUpdates
}
/* If tree is stale, rebuild FIRST so we don't iterate freed