T-054 — Preserve exact CLAP editor dimensions
Status: done · Area: rust
GitHub issue #25 follows up on T-045.
Scope
Keep exact host dimensions during size negotiation and preserve logical dimensions in project state. Test odd physical pixels at 2× scale.
Outcome
PianoMainThread::gui_host_sizekeeps the size in host units that the host last gave throughset_size(afteradjust_size) or that the open window was created at;get_sizeandset_parentuse it, otherwise the kept logical size in host units (size::to_host). It is dropped when the editor closes, and, while the editor is closed, when the scale changes or a project state is loaded. The project still stores rounded logical points: 1001 × 801 at 2× saves 501 × 401 and reopens at 1002 × 802.set_sizenow fails, and changes nothing, when the window cannot be resized.window_sizegives baseview the physical size on Windows as on X11 (baseview 0.4.2 takes a physical size unchanged on Windows;Size::to_physical), logical points on macOS.- Tests:
tests/host.rseditor_size_is_resizable_kept_in_the_project_and_not_in_presets:set_size(1001, 801)at 2× →get_size1001 × 801, saved 501 × 401. The X11 smoke test covers the odd size only when asked:GUI_SMOKE_SCALE=2 GUI_SMOKE_SIZE=500.5x400.5 scripts/gui-smoke-test.sh(in the.#gui-testshell) fails before this task withget_size1002 × 802 and passes after it. - Gates:
cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo nextest run, JuliaPkg.test(),cargo xtask bundle piano --release,clap-validator validate,scripts/gui-smoke-test.sh(default, and at 2× with the odd size above). - Not checked here: Windows (the physical size path is new there), macOS, a real DAW.