patches: reduce completion tracking rate-limit from 500ms to 50ms

500ms (2 Hz) was too aggressive — Zoom focus stopped updating during
keyboard navigation in Vertico/Corfu lists.  50ms (20 Hz) tracks
fast arrow-key navigation while still avoiding per-frame overhead.
UAZoomEnabled() is already cached so the main cost is the overlay
scan, which is cheap.
This commit is contained in:
2026-03-01 06:30:01 +01:00
parent 63f0e899ce
commit cc7b288e99
9 changed files with 75 additions and 74 deletions

View File

@@ -1,4 +1,4 @@
From c38bfe9c3328a9355fe786fea0e6bddcf2bdd54f Mon Sep 17 00:00:00 2001
From 2466072f55f562d96d189814815bf8c4084338b5 Mon Sep 17 00:00:00 2001
From: Martin Sukany <martin@sukany.cz>
Date: Sat, 28 Feb 2026 16:01:29 +0100
Subject: [PATCH 9/9] ns: announce child frame completion candidates for
@@ -109,10 +109,10 @@ index 2102fb9..dd98d56 100644
@end
diff --git a/src/nsterm.m b/src/nsterm.m
index f1aa0a4..27607c0 100644
index 71b6d2e..fd7c520 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7352,6 +7352,112 @@ visual line index for Zoom (skip whitespace-only lines
@@ -7353,6 +7353,112 @@ visual line index for Zoom (skip whitespace-only lines
return nil;
}
@@ -225,7 +225,7 @@ index f1aa0a4..27607c0 100644
/* Build accessibility text for window W, skipping invisible text.
Populates *OUT_START with the buffer start charpos.
Populates *OUT_RUNS with an array of visible runs and *OUT_NRUNS
@@ -8096,16 +8202,25 @@ - (void)ensureTextCache
@@ -8097,16 +8203,25 @@ - (void)ensureTextCache
if (!b)
return;
@@ -259,7 +259,7 @@ index f1aa0a4..27607c0 100644
&& cachedTextStart == BUF_BEGV (b)
&& pt >= cachedTextStart
&& (textLen == 0
@@ -8121,7 +8236,7 @@ included in the cached AX text (it is handled separately via
@@ -8122,7 +8237,7 @@ included in the cached AX text (it is handled separately via
{
[cachedText release];
cachedText = [text retain];
@@ -268,7 +268,7 @@ index f1aa0a4..27607c0 100644
cachedTextStart = start;
if (visibleRuns)
@@ -9089,6 +9204,7 @@ - (void)postCompletionAnnouncementForBuffer:(struct buffer *)b
@@ -9090,6 +9205,7 @@ - (void)postCompletionAnnouncementForBuffer:(struct buffer *)b
ptrdiff_t currentOverlayStart = 0;
ptrdiff_t currentOverlayEnd = 0;
@@ -276,7 +276,7 @@ index f1aa0a4..27607c0 100644
specpdl_ref count2 = SPECPDL_INDEX ();
record_unwind_current_buffer ();
if (b != current_buffer)
@@ -9247,6 +9363,7 @@ - (void)postCompletionAnnouncementForBuffer:(struct buffer *)b
@@ -9248,6 +9364,7 @@ - (void)postCompletionAnnouncementForBuffer:(struct buffer *)b
self.cachedCompletionOverlayEnd = 0;
self.cachedCompletionPoint = 0;
}
@@ -284,7 +284,7 @@ index f1aa0a4..27607c0 100644
}
/* ---- Notification dispatch (main entry point) ---- */
@@ -9843,6 +9960,10 @@ - (void)dealloc
@@ -9844,6 +9961,10 @@ - (void)dealloc
#endif
[accessibilityElements release];
@@ -295,7 +295,7 @@ index f1aa0a4..27607c0 100644
[[self menu] release];
[super dealloc];
}
@@ -11292,6 +11413,9 @@ - (instancetype) initFrameFromEmacs: (struct frame *)f
@@ -11293,6 +11414,9 @@ - (instancetype) initFrameFromEmacs: (struct frame *)f
windowClosing = NO;
processingCompose = NO;
@@ -305,7 +305,7 @@ index f1aa0a4..27607c0 100644
scrollbarsNeedingUpdate = 0;
fs_state = FULLSCREEN_NONE;
fs_before_fs = next_maximized = -1;
@@ -12600,6 +12724,80 @@ - (id)accessibilityFocusedUIElement
@@ -12601,6 +12725,80 @@ - (id)accessibilityFocusedUIElement
The existing elements carry cached state (modiff, point) from the
previous redisplay cycle. Rebuilding first would create fresh
elements with current values, making change detection impossible. */
@@ -386,7 +386,7 @@ index f1aa0a4..27607c0 100644
- (void)postAccessibilityUpdates
{
NSTRACE ("[EmacsView postAccessibilityUpdates]");
@@ -12610,11 +12808,59 @@ - (void)postAccessibilityUpdates
@@ -12611,11 +12809,59 @@ - (void)postAccessibilityUpdates
/* Re-entrance guard: VoiceOver callbacks during notification posting
can trigger redisplay, which calls ns_update_end, which calls us