From d395b0e5950c98c1a9388f7d554a1da4d4e7a46a Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 10:30:29 -0700 Subject: [PATCH] refactor(windows): process_event.rs reads frames through backend().frame() Every WindowsApi::window_rect(hwnd) in process_event.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: commands, lifecycle, resize, move. Verified: Windows clippy -D warnings via tools/fast-check PASS; e2e not run. --- komorebi/src/process_event.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/komorebi/src/process_event.rs b/komorebi/src/process_event.rs index 6c00c302..4aff0d79 100644 --- a/komorebi/src/process_event.rs +++ b/komorebi/src/process_event.rs @@ -658,7 +658,7 @@ impl WindowManager { WindowsApi::bring_window_to_top(window.hwnd)?; - let started_from = WindowsApi::window_rect(window.hwnd)?; + let started_from = backend().frame(WindowId::from_hwnd(window.hwnd))?; let pending_move_op = Arc::make_mut(&mut self.pending_move_op); *pending_move_op = @@ -701,7 +701,7 @@ impl WindowManager { let workspace = self.focused_workspace_mut()?; let focused_container_idx = workspace.focused_container_idx(); - let new_position = WindowsApi::window_rect(window.hwnd)?; + let new_position = backend().frame(WindowId::from_hwnd(window.hwnd))?; // Measure against the rect the window had when the drag started, which is what // the user had under the pointer; a window is not always exactly on its tile // (cell grids, minimum sizes, border insets)