From 7ba4327fa0b9f320215bc55e8cb3235e726cf8fe Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 10:24:14 -0700 Subject: [PATCH] refactor(windows): stackbar_manager/stackbar.rs reads frames through backend().frame() Every WindowsApi::window_rect(hwnd) in stackbar_manager/stackbar.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: stacking. Verified: Windows clippy -D warnings via tools/fast-check PASS; e2e not run. --- komorebi/src/stackbar_manager/stackbar.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/komorebi/src/stackbar_manager/stackbar.rs b/komorebi/src/stackbar_manager/stackbar.rs index 4d5ecb48..8edacd9f 100644 --- a/komorebi/src/stackbar_manager/stackbar.rs +++ b/komorebi/src/stackbar_manager/stackbar.rs @@ -343,10 +343,11 @@ impl Stackbar { let gap = DEFAULT_CONTAINER_PADDING.load_consume(); let focused_window_idx = container.focused_window_idx(); - let focused_window_rect = WindowsApi::window_rect( - container.focused_window().cloned().unwrap_or_default().hwnd, - ) - .unwrap_or_default(); + let focused_window_rect = backend() + .frame(WindowId::from_hwnd( + container.focused_window().cloned().unwrap_or_default().hwnd, + )) + .unwrap_or_default(); for (index, window) in container.windows().iter().enumerate() { let left = gap + (index as i32 * (width + gap));