refactor(windows): border_manager/mod.rs reads frames through backend().frame()

Every WindowsApi::window_rect(hwnd) in border_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: borders. Verified: Windows clippy
-D warnings via tools/fast-check PASS; e2e not run.
This commit is contained in:
LGUG2Z committed 2026-10-31 10:30:21 -07:00
1 parent 74652fb451
commit c700502f15
1 file changed
+5 -3
+5 -3
View File
@@ -8,6 +8,7 @@ use crate::core::BorderStyle;
use crate::core::WindowKind;
use crate::ring::Ring;
use crate::windows_api;
use crate::windows_backend::backend;
use crate::workspace::Workspace;
use crate::workspace::WorkspaceLayer;
pub use border::Border;
@@ -16,6 +17,7 @@ use crossbeam_channel::Receiver;
use crossbeam_channel::Sender;
use crossbeam_utils::atomic::AtomicCell;
use crossbeam_utils::atomic::AtomicConsume;
use komorebi_backend::WindowId;
pub use komorebi_config::behaviour::ZOrder;
use komorebi_themes::colour::Colour;
use komorebi_themes::colour::Rgb;
@@ -678,7 +680,7 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
);
border.window_rect
} else {
WindowsApi::window_rect(focused_window_hwnd)?
backend().frame(WindowId::from_hwnd(focused_window_hwnd))?
};
border.window_rect = rect;
@@ -857,7 +859,7 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
);
border.window_rect
} else {
match WindowsApi::window_rect(focused_window_hwnd) {
match backend().frame(WindowId::from_hwnd(focused_window_hwnd)) {
Ok(rect) => rect,
Err(_) => {
remove_border(&c.id, &mut borders, &mut windows_borders)?;
@@ -963,7 +965,7 @@ fn handle_floating_borders(
);
border.window_rect
} else {
WindowsApi::window_rect(window.hwnd)?
backend().frame(WindowId::from_hwnd(window.hwnd))?
};
border.window_rect = rect;