Repository navigation
Add Leave space for Dock and stop following the auto-hidden Dock - #168
Conversation
BetterTile followed an auto-hidden Dock as it slid in and out. It noticed the Dock only through a 10-second backup check, so a layout tiled while the Dock showed kept an 82-point gap for 15-20 seconds after the Dock hid, and Repair Bento rebuilt the gap from the stale work area. Replace the following with one setting, off by default: - Off: use the work area macOS reports. A hidden Dock draws over windows. - On: keep the Dock's strip free on its display whether the Dock is shown or hidden, and whether auto-hide is on or off. The strip is the Dock's Accessibility list thickness plus 6 points, which matches what macOS reserves for a Dock that never hides. The list keeps its size while hidden. A Dock not shown since it started reports no size, so the thickness last measured on each edge is remembered across launches. This removes the global mouse-move monitor, burst and backup timers, and repeated Dock scans that the following used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review summaryChecked the diff against the PR body (problem/change/evidence/limits/safety) and against Notes (not faults, just what I verified):
I did not execute |
Multi-display live testing found a regression. With a Dock that never hides on the right edge of a secondary display, AppKit inside BetterTile kept reporting that display's full width after the Dock moved there. The old Dock following hid this by reading the Dock itself. Without it, windows went under the Dock. Apply the Dock's strip when Leave space for Dock is on, or when the Dock never hides. macOS reserves the same strip for a Dock that never hides, so this only corrects a late AppKit value. With the setting off and the Dock hiding automatically, the Dock list is still not read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review summaryCompared the diff against the PR body (problem, change, evidence, limits, safety) and against Specifics checked:
The limits already disclosed in the PR body (no live second-display check, first-ever-login case, the quick on/off issue tracked separately in #167) are tooling/environment constraints, not hidden gaps — no further action needed here. |
Problem
With Dock auto-hide on, BetterTile tried to follow the Dock: it shrank the work
area while the Dock was shown and grew it back after the Dock hid. Both steps
were unreliable. It noticed the Dock only through a 10-second backup check, so
a layout tiled while the Dock was shown kept an 82-point gap for 15 to 20
seconds after the Dock hid. Repair Bento in that time rebuilt the gap from the
stale work area.
Change
Settings → Window Layout → Window Mode gets Leave space for Dock, off by
default.
the full screen, and the Dock draws over windows when it slides in.
hidden and whether auto-hide is on or off. Layouts do not move when the Dock
slides in or out.
A Dock that never hides gets the strip with the setting on or off. macOS
reserves the same strip, but AppKit inside a running BetterTile can report a
secondary display's work area late after the Dock moves there or changes edge.
The strip is the thickness of the Dock's Accessibility list plus 6 points. The
list keeps its size while the Dock is hidden. A Dock not shown since it
started, as after login, reports no size, so the thickness last measured on
each edge is remembered across launches. The setting applies to Bento, Tabbed,
snaps, and Maximize. Changing it lays out Bento and Tabbed again at once.
The code that followed the Dock is removed: a global mouse-move monitor, burst
and backup timers, WindowServer Dock window scans, and repeated Dock
Accessibility scans (about 400 lines).
docs/ARCHITECTURE.mdandSECURITY.mddescribe the new reads.
Evidence
Before (
main, live, 2560×1440, auto-hide on, Bento): with the Dock shownfor 13 seconds the layout shrank to 1359, leaving an 82-point gap. After the
Dock hid, the gap stayed for 15 to 20 seconds. Repair Bento with the Dock
hidden rebuilt the gap, which cleared about 25 seconds later.
After, live, setting off: the layout stayed at full height through Dock
show, hide, and Repair.
After, live, setting on (2560×1440 and 1210×812):
Repair. The switch in Settings laid them out again both ways at once.
showed, then the new strip matched macOS exactly.
After, live, three displays side by side (2560×1440 main plus two
BetterDisplay screens), Native, Bento, and Tabbed:
moves to and leaves the others at full height. Existing Bento and Tabbed
layouts follow about 3 seconds after the Dock moves.
and back. The other displays do not change.
on or off.
strip on that display only.
before the Dock is shown.
strip move to the main display.
Regression found and fixed (ee3026e): with the setting off, a right Dock that
never hides on the rightmost secondary display, Maximize there gave 2560
wide, under the Dock, while macOS reported 2482.
maingave 2478 through theold Dock following. Now it gives 2481.
The Dock's list thickness against what macOS reserves for a Dock that never
hides, measured on macOS 26:
Checks run and results:
swift testpasses (all three test targets, run three times).xcodebuildbuilds succeed, signed and withCODE_SIGNING_ALLOWED=NO.remembered thickness, the setting's default and saving, and Bento laying
out again when the setting changes.
Limits
pointer events cannot push past a screen edge. The Dock was moved with
auto-hide on, then auto-hide was turned off.
any app launch, including BetterTile's own, makes the Dock report its size.
A unit test covers it.
macOS by one point.
the layout once when the Dock first appears.
setting off. A quick on-and-off is fixed separately in Lay out Bento again when the work area changes back before settling #167.
main: an existing Tabbed layout does notrefit when a side Dock narrows its display. It logs "placement not
started". Entering Tabbed again lays it out correctly.
Safety
a second, while the setting is on or the Dock never hides. Reads no item
names. Uses the existing Accessibility permission. Also reads the Dock's
orientationandautohidepreferences.defaults. Disclosed in
SECURITY.md.🤖 Generated with Claude Code