From b580b29f4424adc5e50e14175f695172b663b891 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 10:23:05 -0700 Subject: [PATCH] refactor(windows): stackbar_manager/mod.rs reads frames through backend().frame() Every WindowsApi::window_rect(hwnd) in stackbar_manager/mod.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, layouts. Verified: Windows clippy -D warnings via tools/fast-check PASS; e2e not run. --- komorebi/src/stackbar_manager/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/komorebi/src/stackbar_manager/mod.rs b/komorebi/src/stackbar_manager/mod.rs index fe56b941..011b9b1f 100644 --- a/komorebi/src/stackbar_manager/mod.rs +++ b/komorebi/src/stackbar_manager/mod.rs @@ -7,10 +7,12 @@ use crate::container::Container; use crate::core::StackbarLabel; use crate::core::StackbarMode; use crate::stackbar_manager::stackbar::Stackbar; +use crate::windows_backend::backend; use crossbeam_channel::Receiver; use crossbeam_channel::Sender; use crossbeam_utils::atomic::AtomicCell; use crossbeam_utils::atomic::AtomicConsume; +use komorebi_backend::WindowId; use lazy_static::lazy_static; use parking_lot::Mutex; use std::collections::HashMap; @@ -206,9 +208,9 @@ pub fn handle_notifications(wm: Arc>) -> color_eyre::Result stackbars_monitors.insert(container.id.clone(), monitor_idx); - let rect = WindowsApi::window_rect( + let rect = backend().frame(WindowId::from_hwnd( container.focused_window().copied().unwrap_or_default().hwnd, - )?; + ))?; stackbar.update(container_padding, container, &rect)?; }