2.1 KiB
2.1 KiB
name, lang, domain, description, tags, uses_functions, uses_types, framework, entry_point, dir_path, repo_url
| name | lang | domain | description | tags | uses_functions | uses_types | framework | entry_point | dir_path | repo_url | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| altsnap_jitter_test | cpp | tools | Regression test for multi-viewport window jitter triggered by external window movers (AltSnap on Windows, tiling WMs). Drives glfwSetWindowPos every frame and asserts ImGui viewport tracks the OS pos within 1px. |
|
imgui | main.cpp | cpp/apps/altsnap_jitter_test |
altsnap_jitter_test
Headless C++ harness para validar el fix de jitter de multi-viewport (AltSnap, tiling WMs).
Que hace
- Arranca
fn::run_appcon viewports ON (config exacta que reproducia el bug). - Tras 8 frames de warmup, mueve la ventana via
glfwSetWindowPosun step por frame durante 60 frames. - Cada frame muestrea pos OS (
glfwGetWindowPos) y pos ImGui (GetMainViewport()->Pos). - Cuenta divergencias > 1px entre ambos. Cero divergencias = PASS, exit 0.
- Reporta tambien clamp del WM (cuando el compositor rechaza la pos pedida).
Run
WSL/Linux:
cd cpp && cmake -B build/linux -DFN_BUILD_TESTS=OFF
cmake --build build/linux --target altsnap_jitter_test -j4
xvfb-run -a -s "-screen 0 1280x800x24" \
env LIBGL_ALWAYS_SOFTWARE=1 GALLIUM_DRIVER=llvmpipe \
build/linux/apps/altsnap_jitter_test/altsnap_jitter_test
echo "EXIT: $?"
Windows (cross-compile + Desktop deploy):
source bash/functions/infra/e2e_run_cpp_windows.sh
e2e_run_cpp_windows altsnap_jitter_test
Output esperado (PASS)
[altsnap_jitter] f=0 target=(200,200) actual=(200,200) vp=(200.0,200.0) sync_d=0 clamp_d=0
[altsnap_jitter] f=10 target=(240,200) actual=(240,200) vp=(240.0,200.0) sync_d=0 clamp_d=0
...
[altsnap_jitter] DONE frames=60 max_sync_divergence=0px max_clamp_divergence=0px bad_sync=0 bad_clamp=0
[altsnap_jitter] PASS
Criterio de fallo
bad_sync > 0 significa que ImGui viewport->Pos quedo fuera de sincronia con la pos real OS, exactamente la condicion que produce el visible "temblor" cuando AltSnap arrastra la ventana. Ese feedback loop es lo que arregla la patch en cpp/framework/app_base.cpp (callback GLFW + per-frame sync de viewports).