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.
This commit is contained in:
LGUG2Z committed 2026-10-31 10:29:14 -07:00
1 parent 14b6112453
commit 6a4db7dc5e
1 file changed
+3 -2
+3 -2
View File
@@ -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();