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_size keeps the size in host units that the host last gave through set_size (after adjust_size) or that the open window was created at; get_size and set_parent use 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_size now fails, and changes nothing, when the window cannot be resized.
  • window_size gives 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.rs editor_size_is_resizable_kept_in_the_project_and_not_in_presets: set_size(1001, 801) at 2× → get_size 1001 × 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-test shell) fails before this task with get_size 1002 × 802 and passes after it.
  • Gates: cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo nextest run, Julia Pkg.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.