refactor(mac): keep ax_registry in step when a native tab changes a window's id

Step 11(ii), third part. BEHAVIOUR (bookkeeping only). The two places in
process_event.rs that swap a window's id and element in place when a native
tabbed application shows another tab now call ax_registry::sync(old_id,
window): the old id is forgotten and the window registered as it now is, so
the table never names an element that the model has replaced. No AX call is
added.

Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified:
cannot run on Linux. Gate needed: Mac hand check with a tabbed app
(Terminal or Finder tabs; see docs/dev/macos-handcheck.md): switch tabs,
close the first tab, focus the window by command; behaviour must match the
baseline.
This commit is contained in:
LGUG2Z committed 2026-10-31 10:10:53 -07:00
1 parent f0b1a448d4
commit e0687167b4
1 file changed
+4
@@ -316,8 +316,10 @@ impl WindowManager {
workspace.containers_mut().get_mut(container_idx)
&& let Some(window) = container.focused_window_mut()
{
let old_id = window.id;
window.id = window_id;
window.element = AccessibilityUiElement(element.clone());
crate::ax_registry::sync(old_id, window);
}
// check monocle_container for tabbed applications
@@ -349,8 +351,10 @@ impl WindowManager {
&& let Some(monocle) = workspace.monocle_container.as_mut()
&& let Some(window) = monocle.focused_window_mut()
{
let old_id = window.id;
window.id = window_id;
window.element = AccessibilityUiElement(element.clone());
crate::ax_registry::sync(old_id, window);
}
if first_tab_destroyed {