mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-18 06:38:38 +01:00
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:
1 parent
078bdc1666
commit
3a86e8fb6a
2 files changed
+5
-3
No files matched your search
@@ -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 {} ({})",
|
||||
|
||||
@@ -850,7 +850,7 @@ impl Workspace {
|
||||
window.restore();
|
||||
}
|
||||
|
||||
window.set_position(layout, false)?;
|
||||
backend().set_rect(WindowId::from_hwnd(window.hwnd), layout)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user