patches: fix Corfu Zoom tracking — replace rate-limit with parent-frame guard

Root cause: the 50ms rate limit broke child-frame (Corfu) tracking.
When the Corfu child frame redraws, its ns_update_end fires first and
resets the rate-limit timer.  When the parent frame's ns_update_end
fires immediately after, the timer has not expired, so
ns_zoom_track_completion returns early without scanning child frames.
Zoom focus stays on the first candidate.

Fix: remove the rate limit; add a FRAME_PARENT_FRAME(f) guard instead.
Child frames have no completion children to scan; their parent's
ns_update_end does the scan via FOR_EACH_FRAME.  Returning early on
child-frame calls avoids the redundant scan and leaves the timer
problem moot.  Overhead without the rate limit is ~40 Lisp evaluations
per redisplay (~5-20 µs), acceptable given ns_zoom_enabled_p() already
caches the UAZoomEnabled() IPC call.
This commit is contained in:
2026-03-01 07:11:00 +01:00
parent 19cc43dbbb
commit c4975c3fe4
9 changed files with 83 additions and 86 deletions

View File

@@ -1,4 +1,4 @@
From 971bf8f19bec3a89144ddf2375cd17a4d95bb707 Mon Sep 17 00:00:00 2001
From 60516534a246d6ac5b6c91c1e673785943c65fe1 Mon Sep 17 00:00:00 2001
From: Martin Sukany <martin@sukany.cz>
Date: Sat, 28 Feb 2026 12:58:11 +0100
Subject: [PATCH 2/9] ns: add accessibility base classes and text extraction
@@ -188,7 +188,7 @@ index ea6e7ba..6e830de 100644
diff --git a/src/nsterm.m b/src/nsterm.m
index 6527750..3e97248 100644
index 5498d7a..e516946 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -46,6 +46,7 @@ Updated by Christian Limpach (chris@nice.ch)
@@ -199,7 +199,7 @@ index 6527750..3e97248 100644
#include "systime.h"
#include "character.h"
#include "xwidget.h"
@@ -7195,6 +7196,430 @@ - (BOOL)fulfillService: (NSString *)name withArg: (NSString *)arg
@@ -7192,6 +7193,430 @@ - (BOOL)fulfillService: (NSString *)name withArg: (NSString *)arg
}
#endif
@@ -630,7 +630,7 @@ index 6527750..3e97248 100644
/* ==========================================================================
EmacsView implementation
@@ -11651,6 +12076,28 @@ Convert an X font name (XLFD) to an NS font name.
@@ -11648,6 +12073,28 @@ Convert an X font name (XLFD) to an NS font name.
DEFSYM (Qns_drag_operation_generic, "ns-drag-operation-generic");
DEFSYM (Qns_handle_drag_motion, "ns-handle-drag-motion");
@@ -659,7 +659,7 @@ index 6527750..3e97248 100644
Fput (Qalt, Qmodifier_value, make_fixnum (alt_modifier));
Fput (Qhyper, Qmodifier_value, make_fixnum (hyper_modifier));
Fput (Qmeta, Qmodifier_value, make_fixnum (meta_modifier));
@@ -11783,7 +12230,7 @@ Convert an X font name (XLFD) to an NS font name.
@@ -11780,7 +12227,7 @@ Convert an X font name (XLFD) to an NS font name.
doc: /* Non-nil means to use native fullscreen on Mac OS X 10.7 and later.
Nil means use fullscreen the old (< 10.7) way. The old way works better with
multiple monitors, but lacks tool bar. This variable is ignored on
@@ -668,7 +668,7 @@ index 6527750..3e97248 100644
ns_use_native_fullscreen = YES;
ns_last_use_native_fullscreen = ns_use_native_fullscreen;
@@ -11799,10 +12246,19 @@ Nil means use fullscreen the old (< 10.7) way. The old way works better with
@@ -11796,10 +12243,19 @@ Nil means use fullscreen the old (< 10.7) way. The old way works better with
This variable is ignored on Mac OS X < 10.7 and GNUstep. */);
ns_use_srgb_colorspace = YES;
@@ -689,7 +689,7 @@ index 6527750..3e97248 100644
ns_use_mwheel_acceleration = YES;
DEFVAR_LISP ("ns-mwheel-line-height", ns_mwheel_line_height,
@@ -11813,7 +12269,7 @@ Nil means use fullscreen the old (< 10.7) way. The old way works better with
@@ -11810,7 +12266,7 @@ Nil means use fullscreen the old (< 10.7) way. The old way works better with
DEFVAR_BOOL ("ns-use-mwheel-momentum", ns_use_mwheel_momentum,
doc: /* Non-nil means mouse wheel scrolling uses momentum.