From 370dab364a536013dbfed4275c0f59c2546edaeb Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 10:30:21 -0700 Subject: [PATCH] refactor(windows): animation/ghost.rs reads frames through backend().frame() Every WindowsApi::window_rect(hwnd) in animation/ghost.rs becomes backend().frame(WindowId::from_hwnd(hwnd)). WindowsBackend::frame is Window::window_rect, i.e. the same DWM call with the Win32 error kept; the callers' ?, ok(), unwrap_or_default() and is_ok_and() behave as before (only the error text can differ: a window that died meanwhile reports WindowGone). BEHAVIOUR: none intended; e2e gate needed: animation scenarios. Verified: Windows clippy -D warnings via tools/fast-check PASS; e2e not run. --- komorebi/src/animation/ghost.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/komorebi/src/animation/ghost.rs b/komorebi/src/animation/ghost.rs index 0a9d7716..d35714fb 100644 --- a/komorebi/src/animation/ghost.rs +++ b/komorebi/src/animation/ghost.rs @@ -940,6 +940,8 @@ pub fn nudge_swap_chain_window(hwnd: isize, rect: &Rect, top: bool) { #[cfg(test)] mod tests { use super::*; + use crate::windows_backend::backend; + use komorebi_backend::WindowId; #[test] fn swap_chain_classes() { @@ -1193,7 +1195,8 @@ mod tests { // the screen is read in pixels, and the windows were put where they are in // the units of a process that the display's scaling is applied to - let scale = WindowsApi::window_rect(host.0 as isize) + let scale = backend() + .frame(WindowId::from_hwnd(host.0 as isize)) .map(|rect| f64::from(rect.right) / 800.0) .unwrap_or(1.0);