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