Repository navigation
Keep panels still as the macOS menu bar and Dock show and hide - #1024
Merged
Merged
Conversation
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_environmentreads the work area on every update while a panel is open: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.macos.rsobservesNSWorkspaceActiveSpaceDidChangeNotificationand callspoint_scan_runtime::space_changed(). That bumps a counter and starts a 1 s settling window.steady_areakeeps the environment's area while theDisplayand the Space are both unchanged and nothing is settling. Otherwise it uses the fresh work area. After settling,settle_environmentrecords the Space the area belongs to.steady_area.validate_display: on macOS it skips the work-area comparison explicitly, since the area is kept current per Space instead.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.mdandscanner-architecture.md.Validation
npm run prediction-model,npm run lint,npm test(294 passed),npm run buildcargo fmt --check,cargo clippy --all-targets -D warnings,cargo test(748 passed)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.npm run macos:run):🤖 Generated with Claude Code