mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-19 15:18:40 +01:00
BEHAVIOUR for the shared signature; none intended on KDE or Windows. Needs the Windows and KDE gates below. ContainerWindow gets 'type HideSpot: Copy + Default' (() on KDE and Windows; on macOS the monitor's corner and, when known, the display bounds) and its four operations return eyre::Result: hide_window(spot), restore_window(), hide_stacked(spot), restore_stacked(). Container::hide(omit, spot), restore(), load_focused_window(spot) and add_window(window, spot) return Result (hide logs a window that cannot be hidden and goes on, as macOS does; the others propagate). WorkspacePlatform gets two hooks with a default of Default::default(): hide_spot(&globals) (the spot of a window) and hide_spot_on_display(&globals) (the containers of a workspace that is being hidden; macOS passes the display there and not for its floating windows). The eight shared workspace functions that hide (focus_container_by_window, new_container_for_window, move_window_to_container, new_container_for_focused_window, new_monocle_container, reintegrate_monocle_container, new_container_for_floating_window, new_floating_window) and hide take the spot from the hook; new_container_for_window and hide now return Result. KDE and Windows: their Window impls return Ok(()) and take (); about 90 call sites pass () and drop the Ok (let _ = ...) or use ?; nothing is hidden or restored with a different argument than before: the same backend().hide / restore, hide_with_border(false) and restore_with_border(false) calls run in the same order, the Result is always Ok. macOS: the Window impl hides with hide_on(spot.position, spot.screen) and restores, skipping both under cfg!(test) as the old container code did; its ContainerExt is unchanged until the Workspace layer. No silent bind: every shared function whose behaviour depends on the spot changed its signature (an added argument, or a Result where there was none), so any caller written for the old form is a compile error in all three trees (the six unused-Result warnings it produced on each of KDE and Windows were each fixed by hand-checked 'let _ ='). The four macOS-only extension methods (add_window_at, load_focused_window_at, hide_on, restore_focused_window) share no name with a core inherent method (checked: the intersection of the two name lists is empty), so no inherent method can shadow one. Core tests: a stub window records the spot it is given; new tests pin that a floating window is hidden at hide_spot, the containers of a hidden workspace at hide_spot_on_display, and that stacking passes hide_spot through add_window and load_focused_window; the container tests assert the spot. Verified: native cargo test -p komorebi-core 26 passed; fast-check: Windows clippy --all-targets -D warnings PASS, KDE check + lib tests PASS, macOS fake-CC type-check PASS; KDE cargo test -p komorebi-linux --no-fail-fast 672 passed, 0 failed. Not verified: Windows and macOS tests, any run. Verified on the Mini: not yet. Gates for the coordinator: Windows e2e: workspaces, stacking, monocle (the commands scenario), floating (toggle-float), lifecycle, resize, scrolling, borders; KDE VM fast tier plus the stack, workspace, monocle and float scenarios. These exercise exactly the hide/restore/stack paths touched.