patches: regenerate for combined application (Zoom + VoiceOver)
VoiceOver patches 0001-0008 now apply cleanly on top of Zoom patch 0000. The full set (git am patches/000*.patch) works without conflicts. Patch 0005 (integration) merges Zoom fallback and VoiceOver postAccessibilityUpdates in ns_update_end.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
From af7342d4f5f67531b01f636e00885d40a4edeea5 Mon Sep 17 00:00:00 2001
|
||||
From fc690cc07ee404cbc8a2733d4cdb6d9d19f30b2e Mon Sep 17 00:00:00 2001
|
||||
From: Martin Sukany <martin@sukany.cz>
|
||||
Date: Sat, 28 Feb 2026 12:58:11 +0100
|
||||
Subject: [PATCH 5/8] ns: integrate accessibility with EmacsView and redisplay
|
||||
Subject: [PATCH 6/9] ns: integrate accessibility with EmacsView and redisplay
|
||||
|
||||
Wire the accessibility infrastructure into EmacsView and the
|
||||
|
||||
@@ -24,14 +24,14 @@ Known limitations documented in patch 6 Texinfo node.
|
||||
---
|
||||
etc/NEWS | 13 ++
|
||||
src/nsterm.h | 2 +
|
||||
src/nsterm.m | 373 ++++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
3 files changed, 385 insertions(+), 3 deletions(-)
|
||||
src/nsterm.m | 369 +++++++++++++++++++++++++++++++++++++++++++++++++--
|
||||
3 files changed, 376 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/etc/NEWS b/etc/NEWS
|
||||
index ef36df5..e76ee93 100644
|
||||
index f10d17e..f48d05b 100644
|
||||
--- a/etc/NEWS
|
||||
+++ b/etc/NEWS
|
||||
@@ -4389,6 +4389,19 @@ allowing Emacs users access to speech recognition utilities.
|
||||
@@ -4397,6 +4397,19 @@ allowing Emacs users access to speech recognition utilities.
|
||||
Note: Accepting this permission allows the use of system APIs, which may
|
||||
send user data to Apple's speech recognition servers.
|
||||
|
||||
@@ -52,7 +52,7 @@ index ef36df5..e76ee93 100644
|
||||
** Re-introduced dictation, lost in Emacs v30 (macOS).
|
||||
We lost macOS dictation in v30 when migrating to NSTextInputClient.
|
||||
diff --git a/src/nsterm.h b/src/nsterm.h
|
||||
index 8ea15b1..d308a71 100644
|
||||
index 6e830de..dd4e3da 100644
|
||||
--- a/src/nsterm.h
|
||||
+++ b/src/nsterm.h
|
||||
@@ -593,6 +593,8 @@ typedef NS_ENUM (NSInteger, EmacsAXSpanType)
|
||||
@@ -65,41 +65,37 @@ index 8ea15b1..d308a71 100644
|
||||
BOOL font_panel_active;
|
||||
NSFont *font_panel_result;
|
||||
diff --git a/src/nsterm.m b/src/nsterm.m
|
||||
index 3a76a0f..156dba9 100644
|
||||
index 907ce47..d813274 100644
|
||||
--- a/src/nsterm.m
|
||||
+++ b/src/nsterm.m
|
||||
@@ -1105,6 +1105,11 @@ static NSRect constrain_frame_rect(NSRect frameRect, bool isFullscreen)
|
||||
|
||||
unblock_input ();
|
||||
ns_updating_frame = NULL;
|
||||
@@ -1133,6 +1133,9 @@ static NSRect constrain_frame_rect(NSRect frameRect, bool isFullscreen)
|
||||
if (view)
|
||||
view->zoomCursorUpdated = NO;
|
||||
#endif
|
||||
+
|
||||
+#ifdef NS_IMPL_COCOA
|
||||
+ /* Post accessibility notifications after each redisplay cycle. */
|
||||
+ [view postAccessibilityUpdates];
|
||||
+#endif
|
||||
#endif /* NS_IMPL_COCOA */
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3233,6 +3238,18 @@ Note that CURSOR_WIDTH is meaningful only for (h)bar cursors.
|
||||
/* Prevent the cursor from being drawn outside the text area. */
|
||||
@@ -3263,11 +3266,11 @@ Note that CURSOR_WIDTH is meaningful only for (h)bar cursors.
|
||||
r = NSIntersectionRect (r, ns_row_rect (w, glyph_row, TEXT_AREA));
|
||||
|
||||
+#ifdef NS_IMPL_COCOA
|
||||
+ /* Accessibility: store cursor rect for VoiceOver bounds queries.
|
||||
+ accessibilityBoundsForRange: / accessibilityFrameForRange:
|
||||
+ use this as a fallback when no valid window/glyph data is
|
||||
+ available. Skipped when ns-accessibility-enabled is nil. */
|
||||
+ {
|
||||
+ EmacsView *view = FRAME_NS_VIEW (f);
|
||||
+ if (view && on_p && active_p && ns_accessibility_enabled)
|
||||
+ view->lastCursorRect = r;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
ns_focus (f, NULL, 0);
|
||||
|
||||
NSGraphicsContext *ctx = [NSGraphicsContext currentContext];
|
||||
@@ -7281,7 +7298,6 @@ - (id)accessibilityTopLevelUIElement
|
||||
#ifdef NS_IMPL_COCOA
|
||||
- /* Zoom integration: inform macOS Zoom of the cursor position.
|
||||
- Zoom (System Settings -> Accessibility -> Zoom) tracks a focus
|
||||
- element to keep the zoomed viewport centered on the cursor.
|
||||
-
|
||||
- Coordinate conversion:
|
||||
+ /* Store cursor rect and inform macOS Zoom / VoiceOver.
|
||||
+ lastCursorRect is used by:
|
||||
+ - Zoom: UAZoomChangeFocus below (unconditional when active)
|
||||
+ - VoiceOver: accessibilityBoundsForRange: fallback
|
||||
+ Coordinate conversion for Zoom:
|
||||
EmacsView pixels (AppKit, flipped, top-left origin)
|
||||
-> NSWindow (convertRect:toView:nil)
|
||||
-> NSScreen (convertRectToScreen:)
|
||||
@@ -7349,7 +7352,6 @@ - (id)accessibilityTopLevelUIElement
|
||||
|
||||
|
||||
|
||||
@@ -107,7 +103,7 @@ index 3a76a0f..156dba9 100644
|
||||
static BOOL
|
||||
ns_ax_find_completion_overlay_range (struct buffer *b, ptrdiff_t point,
|
||||
ptrdiff_t *out_start,
|
||||
@@ -8376,7 +8392,6 @@ - (NSRect)accessibilityFrame
|
||||
@@ -8444,7 +8446,6 @@ - (NSRect)accessibilityFrame
|
||||
@end
|
||||
|
||||
|
||||
@@ -115,7 +111,7 @@ index 3a76a0f..156dba9 100644
|
||||
/* ===================================================================
|
||||
EmacsAccessibilityBuffer (Notifications) — AX event dispatch
|
||||
|
||||
@@ -8921,7 +8936,6 @@ - (NSRect)accessibilityFrame
|
||||
@@ -8989,7 +8990,6 @@ - (NSRect)accessibilityFrame
|
||||
@end
|
||||
|
||||
|
||||
@@ -123,7 +119,7 @@ index 3a76a0f..156dba9 100644
|
||||
/* ===================================================================
|
||||
EmacsAccessibilityInteractiveSpan — helpers and implementation
|
||||
=================================================================== */
|
||||
@@ -9251,6 +9265,7 @@ - (void)dealloc
|
||||
@@ -9319,6 +9319,7 @@ - (void)dealloc
|
||||
[layer release];
|
||||
#endif
|
||||
|
||||
@@ -131,7 +127,7 @@ index 3a76a0f..156dba9 100644
|
||||
[[self menu] release];
|
||||
[super dealloc];
|
||||
}
|
||||
@@ -10599,6 +10614,32 @@ - (void)windowDidBecomeKey /* for direct calls */
|
||||
@@ -10667,6 +10668,32 @@ - (void)windowDidBecomeKey /* for direct calls */
|
||||
XSETFRAME (event.frame_or_window, emacsframe);
|
||||
kbd_buffer_store_event (&event);
|
||||
ns_send_appdefined (-1); // Kick main loop
|
||||
@@ -164,7 +160,7 @@ index 3a76a0f..156dba9 100644
|
||||
}
|
||||
|
||||
|
||||
@@ -11836,6 +11877,332 @@ - (int) fullscreenState
|
||||
@@ -11904,6 +11931,332 @@ - (int) fullscreenState
|
||||
return fs_state;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user