refactor(windows): frame writes with top = false go through backend()

The two Window::set_position(rect, false) call sites (the workspace
layout update in workspace.rs and the stackbar tab click) now call
backend().set_rect(..), which is Window::set_rect = set_position(rect,
false): the animation, slide-in and live-resize guards are the same.
Not switched: the top = true callers (window.rs move_to_area/center,
workspace.rs maximize area), since the shared set_rect has no top flag, and
all window_rect reads: the shared window_rect is built on window(id), which
asks title, class, exe and path of every window, returns None instead of the
Win32 error and defaults on failure; the 60 call sites rely on Err or
unwrap_or_default, so they stay on WindowsApi::window_rect until the trait
or the adapter has a cheap frame query.

BEHAVIOUR: a dead window fails early with Error::WindowGone, and one
extra IsWindow call per write. e2e gate needed: commands, resize, layouts,
stacking, scrolling, workspaces. Verified: Windows clippy -D warnings via
tools/fast-check PASS; e2e not run.
This commit is contained in:
LGUG2Z committed 2026-10-31 10:22:40 -07:00
1 parent 078bdc1666
commit 3a86e8fb6a
2 files changed
+5 -3

No files matched your search

+4 -2
View File
@@ -360,8 +360,10 @@ impl Stackbar {
// on top of other tiles before eventually ending up in the correct
// tile
if index != focused_window_idx
&& let Err(err) =
window.set_position(&focused_window_rect, false)
&& let Err(err) = backend().set_rect(
WindowId::from_hwnd(window.hwnd),
&focused_window_rect,
)
{
tracing::error!(
"stackbar WM_LBUTTONDOWN repositioning error: hwnd {} ({})",
+1 -1
View File
@@ -850,7 +850,7 @@ impl Workspace {
window.restore();
}
window.set_position(layout, false)?;
backend().set_rect(WindowId::from_hwnd(window.hwnd), layout)?;
}
}
}