Skip to content

Keep panels still as the macOS menu bar and Dock show and hide - #1024

Merged
enaboapps merged 3 commits into
mainfrom
fix/macos-fullscreen-panel-jumps
Oct 12, 2026
Merged

enaboapps merged 3 commits into
mainfrom
fix/macos-fullscreen-panel-jumps

Conversation

@enaboapps

@enaboapps enaboapps commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1023.

Cause

Panels are placed inside NSScreen.visibleFrame. That area leaves out the menu bar and Dock only while they currently show. In a full-screen app, or with either set to hide automatically, they show only while the pointer is at the top or bottom edge.

settle_environment reads the work area on every update while a panel is open:

  • The mouse panel was given the new area each time.
  • The keyboard refitted whenever the area changed.

So both jumped every time a bar slid in or out. Near an edge, that repeated as flicker.

Change

On macOS (WORK_AREA_FOLLOWS_AUTO_HIDE), panels read the work area again only when the active Space changes. That happens when entering or leaving a full-screen app, or choosing another desktop.

  • Space tracking: macos.rs observes NSWorkspaceActiveSpaceDidChangeNotification and calls point_scan_runtime::space_changed(). That bumps a counter and starts a 1 s settling window.
  • Area policy: the pure helper steady_area keeps the environment's area while the Display and the Space are both unchanged and nothing is settling. Otherwise it uses the fresh work area. After settling, settle_environment records the Space the area belongs to.
    • The mouse panel and the keyboard refit both go through steady_area.
    • Point scanning ignores the work area, but it refreshes the area for a keyboard it may open whenever the Space changes.
  • validate_display: on macOS it skips the work-area comparison explicitly, since the area is kept current per Space instead.
  • Still refits straight away: another display, or the same display with a different position, size or scale.
  • Windows unchanged: the flag is off there, and an auto-hidden taskbar never changes the work area.

Trade-off: moving the Dock or changing its size without changing Space takes effect the next time the panel opens or the Space changes. Until then, a panel may overlap the Dock. Panels sit above the menu bar and Dock (screen-saver level) and never take clicks, so the overlap is visual only.

Docs updated in point-scan.md, qwerty-keyboard.md and scanner-architecture.md.

Validation

  • npm run prediction-model, npm run lint, npm test (294 passed), npm run build
  • cargo fmt --check, cargo clippy --all-targets -D warnings, cargo test (748 passed)
  • New tests:
    • panels_keep_their_area_while_auto_hidden_bars_show_and_hide: area kept on the same Space; followed after a Space change and while settling; followed on Windows; refitted for another or resized display.
    • a_space_change_is_counted_and_settles.
  • The macOS-only observer can't be compiled on the Windows dev machine, because the cross-check needs a C toolchain. CI's macOS build covers it.
  • Needs checking on a Mac (npm run macos:run):
    1. Open the keyboard and the mouse panel in a full-screen app. Move the pointer to the top and bottom edges: the panels should stay still.
    2. Leave full screen with the keyboard open: it should refit above the Dock within about a second.
    3. Repeat on a normal desktop with the menu bar and Dock set to hide automatically.

🤖 Generated with Claude Code

NSScreen.visibleFrame leaves out the menu bar and Dock only while they
show, so in a full-screen app, or with either set to hide, the work
area changed whenever the pointer reached a screen edge, and the
keyboard and mouse panel jumped to fit it. On macOS, panels now keep
the area their scan started with while it stays on the same display,
and point scanning no longer ends for that change alone. Closes #1023.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@enaboapps enaboapps added this to the v1.0.0-rc.24 milestone Oct 11, 2026
OwenMcGirr and others added 2 commits October 11, 2026 21:57
Keeping a scan's work area for as long as it stayed on one display left
panels sized for full screen after leaving it, covering a permanent
Dock or menu bar. Panels now read the work area again when the active
Space changes, following it for a second while it settles, and keep it
until the next change. Point scanning keeps the area current for a
keyboard it opens, and the macOS work-area check no longer pretends to
compare anything.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
If the displays or work area could not be read on the first update
after the settling window, the Space was still recorded and the old
area kept until the next Space change. The Space is now recorded only
on an update that read the area.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@enaboapps
enaboapps marked this pull request as ready for review October 12, 2026 06:26
@enaboapps
enaboapps merged commit 2b6603b into main Oct 12, 2026
6 checks passed
@enaboapps
enaboapps deleted the fix/macos-fullscreen-panel-jumps branch October 12, 2026 07:09
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.

Keep scanning panels still when the macOS menu bar or Dock shows and hides

2 participants