Repository navigation
Description
Problem. When an Open or Save panel is focused in an app, cua's macOS engine posts keyboard events to the app's pid, and the panel never receives them. A model can't dismiss the panel with Escape or type a file name into it. The panel is a remote view drawn by com.apple.appkit.xpc.openAndSavePanelService. Other remote-view UI (share sheets, print panels and the like) is likely affected the same way; that is unverified. #212's save sheet came from the owner's own use. This blocks the default-engine flip (#506).
Evidence, live (C-3, run 45339840861 at f239a7b, hosted, the read-only key-route diagnostic of ruling 1198; artifacts in ~/.local/share/cua-m5-pilot/c-3/sitting/key-route/):
| engine | Escape posted to (CGEvent field 40) | seen by | panel closed |
|---|---|---|---|
| vendor | openAndSavePanelService (activation policy prohibited) | the panel service's tap | yes |
| cua | TextEdit | TextEdit's tap | no |
- AX ancestors of the focused element. At depths 0–5 (AXList up to AXSplitGroup),
AXUIElementGetPidreturns TextEdit's pid while the private_AXUIElementGetActualPidreturns the panel service's. At depth 6 (AXWindow) and depth 7 (AXApplication), both return TextEdit's. - cua's
keyboardTarget(native/engine Input.swift:1014) takes the focused element's public GetPid, which is TextEdit.
The vendor's route (static reading of the pinned SkyComputerUseService, confirmed by the run above):
ApplicationUIElement.targetForKeyboardEvent()(0x1006f645c) callsoutOfProcessTarget(for:appPID:).- That walks the focused element's AXParent chain, reading each element's owner with
_AXUIElementGetActualPid, which is soft-linked. - It switches to that pid when the pid differs from the app's and the owner's activationPolicy is prohibited.
- It then posts with CGEventPostToPid (
postToPid0x100249f24). - Ruled out: the HID or session tap, AXUIElementPostKeyboardEvent, and SLEventPostToPid.
- Details: F-helper-logic.md §5–6 and §11;
~/.local/share/cua-m5-pilot/skyre/.
Public routes probed (both lanes):
- Only
NSRunningApplicationby bundle id (com.apple.appkit.xpc.openAndSavePanelService) reaches the service's pid. - These all return TextEdit: CGWindowList owner at the panel frame, top window at the panel centre, frontmost window owner, the app's focused window, the system-wide focused element and application, and frontmostApplication.
- The AXWindow's GetPid read "none".
Design decision (ruling 1202, design session). Take the vendor's route: resolve the owner with the private _AXUIElementGetActualPid, soft-linked through dlsym, and not a public heuristic.
- A heuristic that guesses wrong posts keys to the wrong process, which is worse than today's no-op.
- The private call answers the question directly, and it matches the vendor we are replacing.
- cua's engine is signed by the owner's identity and never goes through App Store review.
- If the symbol doesn't resolve (a future macOS), the engine behaves as today, posting to the app's pid, and says so:
cua doctorgets an engine row naming_AXUIElementGetActualPidunavailable, and the engine's capability report carries it. It is never silent and never a guess.
Fix.
keyboardTargetwalks the focused element's ancestors as the vendor does, and switches to an owner whose pid differs from the app's and whose activationPolicy is prohibited.- Post with CGEventPostToPid to that pid.
- Cover typeText, pressKey and paste alike, and check how the switch interacts with the activation and pointer-refusal rules of macOS engine: synthesized click on a target that holds key focus without being frontmost: activate() exits early, deliver() posts with no hold or repair, and can raise a window unguarded (main) #538 and macOS engine: an element click on a text field keeps its selection (AXPress), where the vendor's click places a caret #258.
- Add the doctor row and its test with the symbol forced missing.
- Bump engineVersion.
Check.
- On a hosted C, the judged cells
openPanel/frontmost/pressKey.escape,openPanel/frontmost/typeText.search,savePanel/frontmost/pressKey.escapeandsavePanel/frontmost/typeText.namepass on cua as on the vendor. - The key-route diagnostic shows cua posting to the panel service.
Activity
SSFSKIM commentedon Nov 24, 2026
[board] in-progress: Taken by cursor235 (ruling 1202)
macOS engine: keys go to the process read after the activation, the w…
Own native engine spec: #582's ruling 1206 entry, the vendor's read o…
macOS engine: both key-target reads drive their process, paste checks…
Own native engine spec: #582's ruling 1207 entry, the residue and the…
Plugin 0.29.22: keys reach remote-view panels on cua's macOS engine (…
#171 0.4.5: version 0.29.21
Merge fix/582-remote-view-keys (69bdbfa: keys to a remote-view panel'…
product-ci-env: a Swift package's own test target under native/ is ha…
macOS engine: the cut-off notice names where keys went, leads the not…
Own native engine spec and tech debt: #582's ruling 1210 entry, and t…
tech-debt: the cut-off notice's unbounded destination name (refs #582)
linux-engine 0.4.5: a Chrome drop under load is answered as it landed (…
Merge main into fix/582-remote-view-keys (refs #582)
macOS engine: keys reach remote-view panels (Open/Save) through the v…
SSFSKIM commentedon Nov 24, 2026
[board] done: Landed via PR #584 (cua 0.29.22)
key-route diagnostic: cua's keyboardTarget mirrors the merged #582 wa…
key-route report: a pre-mirror reading shows its pid as the public on…
Merge origin/main (e54eab4, cua 0.29.22: #584 landing #582, #585) int…