From 5a58e3b925147582d5c824c769ba6a8a08388d7b Mon Sep 17 00:00:00 2001 From: Daneel Date: Sat, 28 Feb 2026 16:34:41 +0100 Subject: [PATCH] patches: 0008 - setAccessibilityElement:NO (suppress window announcement) --- ...d-frame-completion-candidates-for-Vo.patch | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/patches/0008-ns-announce-child-frame-completion-candidates-for-Vo.patch b/patches/0008-ns-announce-child-frame-completion-candidates-for-Vo.patch index 515c3f0..8f0ce03 100644 --- a/patches/0008-ns-announce-child-frame-completion-candidates-for-Vo.patch +++ b/patches/0008-ns-announce-child-frame-completion-candidates-for-Vo.patch @@ -1,4 +1,4 @@ -From a06955c951aaad2330add250f815c34d60128948 Mon Sep 17 00:00:00 2001 +From ee7441e38dc428f86c36045648bac2c487768f48 Mon Sep 17 00:00:00 2001 From: Martin Sukany Date: Sat, 28 Feb 2026 16:01:29 +0100 Subject: [PATCH 2/2] ns: announce child frame completion candidates for @@ -31,14 +31,15 @@ Safety measures: - Buffer size limit (10000 chars) skips non-completion child frames such as eldoc documentation or which-key popups. -Suppress VoiceOver's automatic "X window" announcement by setting -the child frame's accessibility subrole to FloatingWindow (popovers -and floating windows don't trigger window-appeared announcements). +Remove the child frame window from the accessibility tree via +setAccessibilityElement:NO to prevent VoiceOver's blocking +"X window" announcement. Our candidate announcements go to NSApp +(not the window element) and are unaffected. Zoom tracking stores the candidate rect in the PARENT frame's -overlayZoomRect (via screen coordinate conversion), so that the -parent's draw_window_cursor focuses Zoom on the candidate instead -of the text cursor. Cleared when no candidate is found. +overlayZoomRect (via child view -> screen -> parent view coordinate +conversion), so that the parent's draw_window_cursor focuses Zoom +on the candidate instead of the text cursor. * src/nsterm.h (EmacsView): Add announceChildFrameCompletion. * src/nsterm.m (ns_ax_selected_child_frame_text): New function. @@ -63,7 +64,7 @@ index 5c15639..21b2823 100644 @end diff --git a/src/nsterm.m b/src/nsterm.m -index d13c5c7..ea2a914 100644 +index d13c5c7..3735f01 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -7066,6 +7066,110 @@ ns_ax_selected_overlay_text (struct buffer *b, @@ -245,10 +246,10 @@ index d13c5c7..ea2a914 100644 + lastCandidate = xstrdup (cstr); + + /* Suppress VoiceOver's automatic "X window" announcement for -+ the child frame. Completion popups are semantically popovers, -+ not windows. Setting the subrole once is idempotent. */ -+ [[self window] -+ setAccessibilitySubrole:NSAccessibilityFloatingWindowSubrole]; ++ the child frame by removing it from the accessibility tree. ++ Our candidate announcement goes to NSApp (not this window), ++ so it still reaches VoiceOver. Idempotent. */ ++ [[self window] setAccessibilityElement:NO]; + + NSDictionary *annInfo = @{ + NSAccessibilityAnnouncementKey: candidate,