window management library
git clone https://git.lucas.co/cce-window-manager.git
docs(camera): visible_fraction no longer feeds focus-follow
Its doc comment still said "Feeds the focus-follow decision: below a
threshold, the camera pans over" — the rule 8f7f4a3 removed on 2026-09-12,
along with the FOCUS_VISIBLE_THRESHOLD the sentence was describing. The
function has exactly one caller now, `recalled_origin`, which uses it to
decide whether a remembered floating window is visible enough
(RESTORE_VISIBLE_MIN) to be restored where it was.
Focus-follow is `pan_into_view`, and the distinction is the point: it asks
how far a window is OUT of view so it can pan the minimum, where this asks
how much of it is IN view. A comment pointing the second at the first is how
someone ends up wiring a threshold back into focus.
Same correction as 393837b made in CLAUDE.md; this is the copy that lives
next to the code.
Co-Authored-By: Claude Opus 5 <[email protected]>
src/camera.rs | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/camera.rs b/src/camera.rs
index 7a70184..c19e2b6 100644
--- a/src/camera.rs
+++ b/src/camera.rs
@@ -129,7 +129,13 @@ pub fn anchored_interp(start: Camera, end: Camera, p: f64) -> Camera {
}
/// Fraction of a virtual-space window rect visible in the viewport, 0.0–1.0.
-/// Feeds the focus-follow decision: below a threshold, the camera pans over.
+///
+/// Its one caller is [`recalled_origin`], which restores a remembered
+/// floating window where it was only if at least [`RESTORE_VISIBLE_MIN`] of
+/// it would show. It fed the focus-follow decision too until 2026-09-12,
+/// when [`pan_into_view`] replaced "below a threshold, centre it" with the
+/// minimal pan that brings a window fully into view — focus asks how far a
+/// window is out of view, not how much of it is in.
pub fn visible_fraction(
x: f64,
y: f64,