Commit Graph

25 Commits

Author SHA1 Message Date
98ca6a378d patches: move lastCursorRect ivar from patch 1 to patch 5
The ivar was declared in patch 0001 but first used in patch 0005,
creating dead code in intermediate commits 0001-0004.  Now each
commit only introduces declarations that are immediately used.
2026-02-28 22:55:31 +01:00
61b5b5daf1 patches: fix windowWillResize em-dash regression (iteration 3)
Patch 0007 bulk em-dash→triple-dash replacement accidentally changed
windowWillResize title format string and strstr search, introducing
a user-visible regression. Reverted those two lines to em-dash.
2026-02-28 22:45:05 +01:00
9d2b1da729 patches: fix all review blockers (iteration 2)
Fixes from Opus maintainer review:
1. [BLOCKER] Zoom code completely removed from ALL intermediate patches
   (0005-0007 no longer have UAZoom/overlayZoom at any commit point)
2. [BLOCKER] Unified cursor rect ivar: lastCursorRect (was split
   between lastZoomCursorRect and lastAccessibilityCursorRect)
3. [HIGH] Child frame static vars moved to EmacsView ivars
   (childFrameLastCandidate/Buffer/Modiff — no cross-frame interference)
4. [HIGH] intern_c_string replaced with Qbefore_string/Qafter_string
5. [MEDIUM] Zoom fallback gated by zoomCursorUpdated flag (no double call)
2026-02-28 22:39:57 +01:00
d9b4cbb87a patches: restructure per reviewer feedback
Major changes:
1. Zoom separated into standalone patch 0000
   - UAZoomChangeFocus in ns_draw_window_cursor
   - Fallback in ns_update_end for window-switch tracking
   - No overlayZoomActive (source of split/switch/move bug)

2. VoiceOver patches 0001-0008 are now Zoom-free
   - All UAZoom*, overlayZoom*, kUAZoomFocus references removed
   - lastAccessibilityCursorRect kept for VoiceOver bounds queries
   - Commit messages cleaned of Zoom references

3. README.txt and TESTING.txt rewritten for new structure

Addresses reviewer (Stéphane Marks) feedback:
- Keep Zoom patch separate from VoiceOver work
- Design discussion needed for non-Zoom patches
- Performance: ns-accessibility-enabled=nil for zero overhead
2026-02-28 22:28:35 +01:00
bbe683e752 patches: fix 3 blockers — duplicate functions, idx typo, doc cap
BLOCKER fixes:
1. Remove duplicate ns_ax_face_is_selected, ns_ax_selected_overlay_text,
   ns_ax_selected_child_frame_text definitions from patch 0002
   (now defined only in 0007/0008 where they belong)
2. Fix idx → point_idx in accessibilityInsertionPointLineNumber (0002)
3. Remove stale 100K cap reference from documentation (0006)

Architecture fix:
- ns_ax_selected_child_frame_text moved from 0007 to 0008
  (where it logically belongs)

Verified: all 8 patches apply cleanly on fresh emacs HEAD.
2026-02-28 22:00:10 +01:00
30089e9413 patches: fold line index + remove NS_AX_TEXT_CAP into 0001-0002
- 0001: remove NS_AX_TEXT_CAP (100K char cap), add lineStartOffsets/
  lineCount ivars and method declarations to nsterm.h
- 0002: add lineForAXIndex:/rangeForLine: O(log L) helpers, build line
  index in ensureTextCache, replace O(L) line scanning in
  accessibilityInsertionPointLineNumber/accessibilityLineForIndex/
  accessibilityRangeForLine, free index in invalidateTextCache/dealloc
- 0009 deleted (folded into 0001+0002)
- README.txt: remove NS_AX_TEXT_CAP references, update known
  limitations, stress test threshold 50K lines
2026-02-28 21:39:30 +01:00
c82ef86eaf patches: fix 0008 — forward reference + blank lines (maintainer review)
Move file-scope statics (lastChildFrameBuffer/Modiff/Candidate) and
ns_ax_reset_accessibility_updating before announceChildFrameCompletion.
Using them before their declaration was a forward reference (UB in C).

Remove two spurious blank lines at start of announceChildFrameCompletion
method body.
2026-02-28 19:26:55 +01:00
Martin Sukany
98b3d04597 Revert "patches: add 0009 resource safety hardening + update 0007/0008"
This reverts commit acc2a2985e.
2026-02-28 19:05:02 +01:00
acc2a2985e patches: add 0009 resource safety hardening + update 0007/0008
New patch 0009 fixes HIGH severity issues from Opus review:
- Announcement coalescing (50ms debounce)
- cachedText retain+autorelease in accessibilityValue
- EmacsView dealloc: nil out emacsView on all AX elements
- Nil guards on protocol methods + overlayZoomActive

0007 updated: revert accidental em-dash→triple-dash, add overlayZoomActive nil guards
0008 updated: specpdl exception safety for accessibilityUpdating, lastChildFrameBuffer staticpro

Series now 9 patches total (0001-0006 unchanged, 0007-0009 new/updated).
2026-02-28 18:45:30 +01:00
0f7608326c patches: fix 2 blockers from Opus review
BLOCKER #1: accessibilityUpdating flag exception safety.
A Lisp signal (longjmp) during postAccessibilityUpdates left
the re-entrance flag permanently YES, suppressing all future
AX notifications → VoiceOver goes silent randomly.
Fix: specpdl unwind protection (record_unwind_protect_ptr)
resets the flag on any longjmp. All 3 exit points use unbind_to.

BLOCKER #2: static struct buffer *lastBuffer dangling pointer.
Raw C pointer to buffer struct has no GC protection. After
kill-buffer, the pointer dangles.
Fix: file-scope Lisp_Object lastChildFrameBuffer with staticpro.
EQ comparison instead of pointer equality.

Also: revert accidental em-dash → triple-dash in title bar (0007),
fix README factual error (BUF_OVERLAY_MODIFF cache key).
2026-02-28 18:29:19 +01:00
c05b46b058 patches: 0007 textDidChange fix (hl-line-mode), remove config workaround 2026-02-28 17:42:00 +01:00
edbed0a116 patches: 0007 fix hl-line-mode blocking SelectedTextChanged
hl-line-mode (and similar) bumps BUF_MODIFF via text property
changes on every cursor movement. The else-if structure caused
the modiff branch to fire (skipping ValueChanged correctly) but
also blocked the cursor-move branch (SelectedTextChanged).

Fix: use textDidChange flag to decouple the two branches.
ValueChanged and SelectedTextChanged remain mutually exclusive
for real edits, but SelectedTextChanged now fires when only
text properties changed.
2026-02-28 17:38:05 +01:00
2d053f5a92 patches: 0008 fix EmacsAccessibilityBuffer class name 2026-02-28 17:24:44 +01:00
4c7ce352cd patches: 0008 focus restore after child frame close + corfu delay 2s
- childFrameCompletionActive flag: set by child frame handler,
  cleared when no child frame visible on parent's next cycle
- Posts FocusedUIElementChanged on parent buffer element to
  restore VoiceOver character echo after corfu closes
- corfu-auto-delay: 1.0 → 2.0 (reduce popup noise)
2026-02-28 17:21:44 +01:00
afa65a8201 patches: 0008 restored to confirmed working version (3e5fe81)
Pure version: direct UAZoomChangeFocus, specpdl_ref, re-entrance
guard, buffer switch + unbind_to. No window announcement suppression
(all attempts broke VoiceOver focus tracking or Zoom).
2026-02-28 17:08:49 +01:00
e09b8c61f0 patches: 0008 - setTitle:empty instead of setAccessibilityElement:NO 2026-02-28 17:04:06 +01:00
306cde4f79 patches: restore 0008 + setAccessibilityElement:NO (no Zoom changes)
Restore working 0008 (direct UAZoomChangeFocus, specpdl_ref fix,
re-entrance guard, buffer switch). Only addition: suppress child
frame window announcement via setAccessibilityElement:NO.
No overlayZoomRect/overlayZoomActive changes — 0007 untouched.
2026-02-28 16:59:05 +01:00
9772b7e33e patches: drop 0008 (child frame), revert 0007 to clean state
Child frame completion (Corfu) will be handled via config:
corfu-terminal-mode renders as overlays → patch 0007 handles it.
2026-02-28 16:48:53 +01:00
1455542227 patches: 0008 - GroupRole + focus restore + overlayZoom reset
- NSAccessibilityGroupRole (no window announcement, focus tracking OK)
- FocusedUIElementChanged on parent when corfu closes
- overlayZoomActive = NO reset each parent cycle (handles C-g + frame delete)
2026-02-28 16:43:26 +01:00
5a58e3b925 patches: 0008 - setAccessibilityElement:NO (suppress window announcement) 2026-02-28 16:34:41 +01:00
2dc4182856 patches: 0008 - Zoom via parent overlayZoomRect + suppress window announcement 2026-02-28 16:29:26 +01:00
3e5fe814b8 patches: 0008 fix specpdl_ref type (not ptrdiff_t) 2026-02-28 16:19:08 +01:00
5aa0f05a33 patches: 0008 fix current_buffer bug + unbind_to on all return paths
Fbuffer_substring_no_properties operates on current_buffer, not the
passed buffer. Added set_buffer_internal_1 + record_unwind_current_buffer
with unbind_to on every return path.
2026-02-28 16:15:41 +01:00
659b9e2a1e patches: 0008 fix - re-entrance guard + modiff gate + safety checks
Root cause: child frame path bypassed accessibilityUpdating guard.
Lisp calls in announceChildFrameCompletion triggered redisplay →
ns_update_end → postAccessibilityUpdates → infinite recursion.
2026-02-28 16:11:23 +01:00
a8af58cff1 patches: split 0007 (overlay) + 0008 (child frame)
0007: Vertico/Icomplete/Ivy overlay completion, Zoom at text left edge
0008: Corfu/Company-box child frame completion, direct UAZoomChangeFocus
2026-02-28 16:02:13 +01:00