mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-15 13:22:19 +01:00
Windows call sites read the frame about 60 times and rely on the Win32 error (or unwrap_or_default). The shared window_rect is built on window(id), which also asks title, class, exe and path and gives None for every failure. Add the provided method Backend::frame(id) -> Result<Rect>: WindowGone for an unknown window, Platform for a failed read. The default goes through window() (a table lookup on KDE through Shared<B> and on the fake, so the cached/requested-rect semantics of seam.md section 2 row 2 are kept); WindowsBackend overrides it with Window::window_rect (one DWM call) and MacosBackend with MacosApi::window_rect (the two Accessibility reads, no metadata). The contract tests check frame agrees with window().rect and is WindowGone for an unknown id; FakeBackend gets a test. A provided method, so no adapter had to change to compile. Not a behaviour change (nothing calls it yet). Verified: tools/fast-check (native crate tests pass, Windows clippy -D warnings, KDE check + lib tests, macOS fake-CC type-check) PASS; macOS cannot be run here.