Skip to content

Reveal the autohide dock sooner - #25

Open
RayTrunk wants to merge 2 commits into
SumirSeth:mainfrom
RayTrunk:feat/autohide-reveal-sooner
Open

RayTrunk wants to merge 2 commits into
SumirSeth:mainfrom
RayTrunk:feat/autohide-reveal-sooner

Conversation

@RayTrunk

@RayTrunk RayTrunk commented Nov 7, 2026

Copy link
Copy Markdown

What changed
While the autohide dock is hidden and the pointer is in the lower third of its screen, the dock checks the pointer every 15 ms instead of every 100 ms (NEAR_POLL_MS). Elsewhere, over a full-screen app, and whenever the dock is shown, the poll stays at 100 ms. That keeps HIDE_AFTER at the same half second.

Why
The reveal waited for the next 100 ms poll, which added 0–100 ms before the slide even started (#20). Of the options in the issue I chose faster polling near the edge:

  • A low-level mouse hook would route every mouse move on the system through the dock's UI thread, which also renders.
  • A thin edge window would take clicks on the screen's bottom pixel row (scroll bars, full-screen apps) and has to follow every monitor.

The lower third is big enough that a quick move to the edge usually passes through it before the next slow poll.

How I checked it
Windows 11, 2560×1440 at 125% plus a second screen, position = "bottom", dock_autohide = true. A script parked the pointer at y=600, waited for the dock to hide, moved the pointer to the bottom edge, then timed from arrival until the dock window showed (15 trials each):

Move to the edge main this change
Fast move over 80 ms median 47 ms, max 89 ms median 3 ms, max 27 ms
Jump from y=600 (never in the lower third) median 61 ms, max 109 ms median 36 ms, max 100 ms

The jump case doesn't benefit by design, since no poll sees the pointer near the edge first; it shows the old range for reference.

CPU, dock hidden, pointer still for 20 s: below the 15.6 ms resolution of the process timers in both builds (0–31 ms per 20 s, under 0.2 %).

cargo fmt --check and both clippy runs pass. cargo test fails the same two tests as on unmodified main on my German Windows (commands::time::tests::finds_cities_in_the_windows_zone_list, commands::tests::finds_power_commands_time_and_settings).

Not tested: Windows 10, virtual desktops, the dock on a secondary screen's edge (the check uses the pointer's own monitor, like at_bottom_edge).

The hide delay of about 0.6–0.7 s is unchanged; the issue calls it by design.

Fixes #20

🤖 Generated with Claude Code

RayTrunk and others added 2 commits November 7, 2026 20:12
The hidden dock checked the pointer every 100 ms, so it started to slide
in up to 100 ms after the pointer reached the bottom edge (SumirSeth#20). While the
pointer is in the lower third of a screen, it now checks every 15 ms. Once
the dock is shown, it goes back to 100 ms, so it still hides after the
same half second away. Over a full-screen app it keeps the slow poll.

Measured with a fast 80 ms move to the edge, from arrival to the dock
showing: median 47 ms and up to 89 ms before, median 3 ms and up to 27 ms
after.

Fixes SumirSeth#20

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Reveal the autohide dock sooner

1 participant