docs: preserve application focus during Emacs capture

This commit is contained in:
Kinneyzhang 2026-09-06 20:50:02 +08:00
parent c06f9ef2dc
commit d5cf6c62f5
2 changed files with 22 additions and 4 deletions

View File

@ -8,6 +8,8 @@
- GUI 与性能自动化先查 `scripts/README.md`、`scripts/emacs-gui-verifier.el`
及既有 Makefile 入口;公共机制归 `scripts/`,具体业务场景归示例仓库。
- 现有 Emacs 的截图与录像默认保留用户当前应用焦点,使用已登记的窗口捕获
入口;后台视觉证据须检查内容更新,后台耗时与前台输入到显示延迟分别报告。
- 连续 resize 使用 `scripts/benchmark-ebox-resize.el`
`ebox-resize-benchmark-start`,适用于现有 ETAF 或独立 Ebox buffer。
按 README 选择范围、轮数和新证据文件;先验证前台与已加载版本,保留全部样本,

View File

@ -4,8 +4,9 @@ For an already running Emacs, use its existing server through `emacsclient`.
Load the checkout and call the example entry point in an explicit buffer, show
that buffer in the existing graphical frame, and capture only that owned
window. Preserve the user's font and chrome. Do not start another daemon or
frame for this workflow. The `emacsclient-render-capture` skill supplies the
foreground and before/after target guards.
frame for this workflow. Preserve application focus so the user can keep working
in other apps. The `emacsclient-render-capture` skill supplies buffer selection
without activation and before/after target guards.
This directory also owns reusable verification mechanisms; application
scenarios live in their respective example repositories:
@ -21,12 +22,14 @@ scenarios live in their respective example repositories:
generation, and exact cleanup.
- `record-emacs-window.swift` uses macOS 15 ScreenCaptureKit to record only the
frame owned by the supplied Emacs PID. It follows replacement window IDs and
rejects changed pixel mappings. Its canvas is fixed at recording start:
rejects changed pixel mappings. Its desktop-independent window filter works
without activating Emacs. Its canvas is fixed at recording start:
when the scenario includes resize, prepare the largest tested frame before
starting the recorder. Smaller windows retain native pixels with padding;
a window larger than the original canvas invalidates the recording.
- `capture-emacs-window.sh` supplies window-only checkpoint screenshots and
rejects missing, ambiguous, or changing frame identities. The runner compiles
rejects missing, ambiguous, or changing frame identities without activating
Emacs. The runner compiles
the video helper using the system Swift compiler; no package install is needed.
Concrete repositories provide adapter files that construct a Scenario and an
@ -52,6 +55,19 @@ run reports its actual interaction assertions and inspected screenshots
separately. A failed recorder is never evidence of continuous capture, and
neither screenshots nor recording establish an operation latency bound.
For an existing server, take a background screenshot with the observed process ID:
```sh
ETAF_GUI_CAPTURE_PID=12345 scripts/capture-emacs-window.sh -x /tmp/app-checkpoint.png
```
Keep the target frame open and non-minimized. Validate a known content change in
before/after pixels to establish fresh background rendering. Hidden, minimized,
off-Space and locked-session behavior is not covered by this procedure. Background
Lisp callbacks and runtime timing do not require application activation; report
them as background measurements, separately from foreground input-to-display
latency. Use Emacs-local operations while another app is active, not global input.
## Continuous resize on the existing server
Use this entry for resize performance investigations instead of copying the