From 6a4db7dc5e2d83e8ccab293b4dd2466915505cea Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 10:29:00 -0700 Subject: [PATCH] refactor(windows): scrolling.rs reads frames through backend().frame() Every WindowsApi::window_rect(hwnd) in scrolling.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: scrolling. Verified: Windows clippy -D warnings via tools/fast-check PASS; e2e not run. --- komorebi/src/scrolling.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/komorebi/src/scrolling.rs b/komorebi/src/scrolling.rs index 5e07e6b7..51994f50 100644 --- a/komorebi/src/scrolling.rs +++ b/komorebi/src/scrolling.rs @@ -18,9 +18,10 @@ use crate::core::Rect; use crate::core::ScrollingLayoutOptions; use crate::core::Sizing; use crate::core::WindowHandlingBehaviour; -use crate::windows_api::WindowsApi; +use crate::windows_backend::backend; use crate::workspace::Workspace; use color_eyre::eyre; +use komorebi_backend::WindowId; use komorebi_layouts::scrolling; use komorebi_layouts::scrolling::ScrollingPlacement; use komorebi_scrolling::ColumnWidth; @@ -201,7 +202,7 @@ impl Workspace { .iter() // a window that is hidden has not been where it was told to be .filter(|window| !crate::HIDDEN_HWNDS.lock().contains(&window.hwnd)) - .filter_map(|window| WindowsApi::window_rect(window.hwnd).ok()) + .filter_map(|window| backend().frame(WindowId::from_hwnd(window.hwnd)).ok()) .map(|actual| actual.right - placed.right) .max() .unwrap_or_default();