Commit Graph
4 Commits
Author SHA1 Message Date
LGUG2Z 18ca78196f refactor(windows): centre cursor, focus-follows-mouse off and unminimize go through backend()
window_manager.rs: three WindowsApi::center_cursor_in_rect calls become
backend().center_cursor_in(..) and WindowsApi::disable_focus_follows_mouse
becomes backend().set_focus_follows_mouse(false); workspace.rs: the
WindowsApi::restore_window that unmaximizes a window becomes
backend().unminimize(..) (the same ShowWindow call, after an IsWindow check).
backend-switch.md now lists every WindowsApi call left in window_manager,
workspace and monitor and why each cannot be switched without changing an
error, a default or a flag (foreground_window, cursor_pos, focus on the
desktop window, position_window flags, start-up enumeration, monitor fields).

BEHAVIOUR: a dead window is skipped by the unminimize. e2e gate needed:
commands, focus_follows_mouse, maximizing, workspaces. Verified: Windows
clippy -D warnings via tools/fast-check PASS; e2e not run.
2026-10-31 11:20:32 -07:00
LGUG2Z 292a9ed567 docs(windows): record which call sites go through backend()
docs/dev/backend-switch.md now has the table of what is switched (focus,
set_rect with top = false, frame reads, plain hide/restore, minimize,
close, raise, maximize), what is left in the Windows crate on purpose
(top = true set_position, the *_with_border calls, transition and ghost
machinery, set_opacity: border and animation subsystems are platform-owned,
seam.md rule 5), and, for each query not switched (foreground_window,
cursor_pos, monitors, window, monitor_from_point), what the trait would
need so step 9 can decide.

Docs only.
2026-10-31 10:33:38 -07:00
LGUG2Z f5a299aa9e refactor(windows): minimize, close and raise go through backend()
process_command (close and minimize of the foreground window, four raise
calls) and monitor_reconciliator (four minimize calls) now call
backend().close/minimize/raise. WindowsBackend runs Window::close,
minimize and raise unchanged (minimize still leaves komorebi-bar alone).
docs/dev/backend-switch.md now holds the full table of what is switched
and what is left, including why the queries (window_rect,
foreground_window, cursor_pos, monitors) were NOT switched: each would drop
an error that callers use or report, or fabricate a default.

BEHAVIOUR: a dead window is skipped by an IsWindow check first; minimize
results are ignored as before. e2e gate needed: commands, monitor
reconciliation (monitor_reconciliator), lifecycle. Verified: Windows clippy
-D warnings via tools/fast-check PASS; e2e not run.
2026-10-31 10:22:41 -07:00
LGUG2Z 078bdc1666 refactor(windows): focus goes through backend()
Switch the 40 Window::focus(mouse_follows)? call sites in process_event,
process_command, workspace, window_manager, focus_manager and the
stackbar click to backend().focus(WindowId::from_hwnd(..), mouse_follows).
WindowsBackend::focus runs Window::focus, so the deferral while a window
slides in, the already-foreground shortcut and the cursor centring are
unchanged. animation/transition.rs:534 stays on Window::focus (it is the
code Window::focus defers to). docs/dev/backend-switch.md records what is
switched.

BEHAVIOUR: a dead window now fails early with Error::WindowGone (before:
the Win32 error from raise_and_focus_window) and a failed focus of a window
that died meanwhile reports WindowGone; every caller uses ? or ignores the
result. e2e gate needed: commands, focus, focus_follows_mouse, stacking,
workspaces, lifecycle. Verified: Windows clippy -D warnings via
tools/fast-check PASS; e2e not run.
2026-10-31 10:22:40 -07:00