Commit Graph

61 Commits

Author SHA1 Message Date
6933d8f9c0 v4 patch: dual mechanism with Apple doc references
UAZoomChangeFocus (documented Apple API) + NSAccessibility.
References to official Apple documentation in comments.
Pattern matches iTerm2 implementation.
2026-02-25 18:11:05 +01:00
f3b8ff661c v3 patch: NSAccessibility-only, drop UAZoomChangeFocus per reviewer feedback 2026-02-25 17:50:04 +01:00
Martin Sukany
8a8e71764d update 2026-02-25 17:09:08 +01:00
a234ded3db Rewrite Zoom a11y patch: NSAccessibility primary, UAZoomChangeFocus supplementary
Key changes:
- Add accessibilityFrame on EmacsView returning cursor screen rect
  (the standard mechanism used by Terminal.app, iTerm2, Firefox)
- Guard UAZoomChangeFocus with bundleIdentifier check (bare binaries
  are silently ignored by the window server)
- Extensive English comments explaining both mechanisms
- Deduplicate legacy parameterized attribute via accessibilityBoundsForRange:

Root cause of Stéphane's failure: UAZoomChangeFocus communicates via the
window server which identifies apps by CFBundleIdentifier. Bare binaries
(src/emacs, symlinks) have no bundle ID and are ignored. NSAccessibility
notifications + accessibilityFrame work for ALL launch methods.
2026-02-25 17:02:40 +01:00
Martin Sukany
365219c4d1 patch updated 2026-02-23 10:55:10 +01:00
87003cac96 fix: use manual y-flip instead of accessibilityConvertScreenRect:
Compilation error: EmacsView does not declare NSAccessibility conformance
so accessibilityConvertScreenRect: is not visible to the compiler.
Replaced with manual coordinate conversion:
  primaryH = NSScreen.screens.first.frame.height
  cgRect.origin.y = primaryH - cgRect.origin.y - cgRect.size.height
2026-02-23 10:28:02 +01:00
5196674d9e fix: UAZoomChangeFocus() — actual fix for macOS Zoom cursor tracking
Root cause found via research pipeline:
NSAccessibility notifications alone are insufficient for custom NSView.
macOS Zoom 'Follow keyboard focus' requires UAZoomChangeFocus() from
HIServices/UniversalAccess.h — same as iTerm2 and Chromium.

Squashed into single clean patch. 159 insertions, 2 files.
2026-02-23 10:22:59 +01:00
56db072f06 fix: add NSAccessibilityPostNotification (key missing piece)
macOS Zoom is event-driven -- it only queries AXBoundsForRange after
receiving NSAccessibilitySelectedTextChangedNotification. Previous
version implemented the bounds methods but never posted notifications,
so Zoom never triggered a cursor position query.

Added:
- NSAccessibilityPostNotification(SelectedTextChanged) in ns_draw_window_cursor
- NSAccessibilityPostNotification(FocusedUIElementChanged) in windowDidBecomeKey
- accessibilityAttributeNames + accessibilityAttributeValue: for
  NSAccessibilitySelectedTextRangeAttribute -> returns {0,0}
2026-02-23 10:03:51 +01:00
12869677e7 fix: correct hunk line count in patch (83→91) 2026-02-23 09:22:51 +01:00
ce46e5b7eb fix: add accessibilityBoundsForRange: (new NSAccessibilityProtocol) + isAccessibilityElement
Old parameterized attribute API alone insufficient — macOS Zoom prefers
the new NSAccessibilityProtocol method accessibilityBoundsForRange:.
Also adds isAccessibilityElement returning YES.

Both APIs now implemented for compatibility across macOS versions.
2026-02-23 09:19:51 +01:00
e6d6fc62fd feat: add NSAccessibility AXBoundsForRange patch for macOS Zoom cursor tracking 2026-02-22 23:31:12 +01:00