Files
komorebi/crates
LGUG2Z 0a2562b9cf feat(backend): frame(id) is a cheap live frame query with the reason for a failure
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.
2026-10-31 10:22:38 -07:00
..