From 14b61124533a84c8cb312b234adcf29711dce544 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 10:28:51 -0700 Subject: [PATCH] refactor(windows): pan.rs reads frames through backend().frame() Every WindowsApi::window_rect(hwnd) in pan.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 pan. Verified: Windows clippy -D warnings via tools/fast-check PASS; e2e not run. --- komorebi/src/pan.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/komorebi/src/pan.rs b/komorebi/src/pan.rs index 48e85eb6..d835cde5 100644 --- a/komorebi/src/pan.rs +++ b/komorebi/src/pan.rs @@ -12,8 +12,9 @@ use crate::core::Rect; use crate::live_resize; use crate::live_resize::Snapping; use crate::window_manager::WindowManager; -use crate::windows_api::WindowsApi; +use crate::windows_backend::backend; use color_eyre::eyre; +use komorebi_backend::WindowId; use komorebi_scrolling::ScrollingSpace; use komorebi_scrolling::SwipeTracker; use parking_lot::Mutex; @@ -97,7 +98,7 @@ impl WindowManager { let work_area = self.focused_monitor_work_area()?; let workspace = self.focused_workspace()?; let near: Vec<_> = origins(&workspace.scrolling_lefts(), |hwnd| { - WindowsApi::window_rect(hwnd).ok() + backend().frame(WindowId::from_hwnd(hwnd)).ok() }) .into_iter() .filter(|(_, origin)| live_resize::is_near(origin, &work_area))