Skip to content

fix: A sprite past the Dock's real end falls instead of walking on air - #145

Merged
omesser merged 6 commits into
mainfrom
fix-dock-true-bounds
Aug 31, 2026
Merged

omesser merged 6 commits into
mainfrom
fix-dock-true-bounds

Conversation

@omesser

@omesser omesser commented Aug 31, 2026 •

Copy link
Copy Markdown
Owner

read_displays builds the floor from the work area, and the work area reserves a full-width strip for the Dock — so the floor ran wall to wall while the Dock itself does not, and a sprite walking past the Dock's real end kept standing on the strip: walking on air. #39 chose that strip deliberately, because CGWindowListCopyWindowInfo reports the Dock as a window covering the whole display (verified again while writing this: the layer-20 Dock window is exactly the display's rectangle).

What

The Dock's true rectangle now comes from a chain that degrades silently, and the startup log names the rung that answered:

  1. CoreDockGetRect — private CoreDock SPI, adopted knowingly: exact bounds for every user with zero grants. Treated as the unversioned thing it is: resolved by dlsym at runtime (never linked, so its removal costs the rung, not the launch) and believed only after plausible_dock agrees the answer is shaped like a bottom Dock — a thin horizontal strip standing in the margin the work area reserved. A full-display rect, an empty one, a bar floating mid-screen, or a claim on a display that reserved nothing all fall through.
  2. The Accessibility API — public, trust-gated, never prompted for (DESIGN.md decision 9): keeps paying where trust was already granted, through the same plausibility gate.
  3. The full-width work-area strip — today's behavior, unchanged, never a crash.

With a true rectangle, the Dock becomes a real Perch (frontmost — it draws above every application window — with a reserved id so a resizing Dock is ridden, #109) and floor_under_dock drops the floor beside it to the display's own bottom edge. A walk past the Dock's end falls; landing beside the Dock lands in the true corner; standing on the Dock stands on it, and the Director hears "the top of the Dock". A side-pinned Dock reports nothing (its wall is already where the work area puts it); a hidden Dock reserves nothing, unchanged.

The two live rungs frame the Dock differently — CoreDock reports the reserved strip (top at 982 on the reporting desktop, the exact line #39 chose by hand), AX reports the drawn island (top at 978) — so the preferred rung is also the one that keeps #39's resting line.

One smaller lie remains, named here deliberately: windows are not obstacles in the Engine, so a sprite walking along the true bottom can pass behind the Dock's island for the few steps of its span. That is transient and beats the permanent air-walk; solidity would be an Engine feature, not a Dock fix.

Alternatives surveyed

Measured on the reporting desktop against the AX rect (234, 978, 1452x92); also recorded in dock.rs's module doc so the hunt is not repeated:

Source Exactness Permission Verdict
All Dock-owned windows via CGWindowListCopyWindowInfo (bounds+layer+alpha, on-screen and all) none — 3 windows: layer-20 at the full display frame, 2 wallpaper backstops none no signal exists in the window list
Estimate from com.apple.dock defaults + running apps + Trash 44–100 points short on the machine its constants were tuned against none rejected: an icon or two of error puts the fall line mid-icon, and recents/minimized/spacers/magnification move it again
CoreDockGetRect (private CoreDock SPI) exact — (233, 982, 1453x98), ±1 point of the AX span — and works untrusted (verified from a launchd-spawned process) none adopted as rung 1, dynamically resolved and plausibility-gated
CGSGetDockRectWithReason/SLSGetDockRectWithReason symbols exist, ABI unprobed none (presumed) same class as CoreDock, worse layer
AXUIElementCopyElementAtPosition, screen capture — Accessibility / Screen Recording rejected: same gate as rung 2, or a worse consent

Verify

  • cargo test --all-targets (351 — including the plausible_dock gate: both measured shapes believed, five lies refused) and node --test tests/ (22).
  • Live, by hand: cd src-tauri && cargo test dock -- --ignored --nocapture prints the rectangle and its rung — Some((Rect { x: 233.0, y: 982.0, width: 1453.0, height: 98.0 }, CoreDock)) on the desk this was written at, no permission dialog.
  • In the app, no grants needed: walk the buddy off the Dock's end — it falls to the bottom corner instead of walking on air; drop it over the Dock — it rests on the island, Perched. The startup line reads dock: true bounds via CoreDock, ….

🤖 Generated with Claude Code

omesser and others added 5 commits August 31, 2026 23:01
CGWindowList reports the Dock as a full-display window and the work
area reserves a full-width strip, so the floor ran wall to wall while
the Dock does not. With trust already granted (never prompted for,
DESIGN.md decision 9) the Dock's AX frame makes it a real Perch and
the floor beside it drops to the display's own bottom edge.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…hape

Exact bounds for every user with zero grants. The private symbol is
looked up at runtime so a release removing it costs the rung and not
the launch, and its answer is believed only when plausible_dock agrees
it is shaped like a bottom Dock standing in the reserved margin. The
Accessibility rung keeps paying where trust exists; the full-width
strip stays the fallback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tion

The transmute's comment now says what dlsym cannot prove and where the
accepted ABI risk lives; plausible_dock and floor_under_dock get their
own docs and share centered_in; the no-Dock log line stops promising
what a grant cannot deliver; and only the display that holds the Dock
narrates its floor as beside it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@omesser
omesser merged commit 4c93181 into main Aug 31, 2026
2 checks passed
@omesser
omesser deleted the fix-dock-true-bounds branch August 31, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant