Repository navigation
Show the real cursor over password prompts drawn above the hand - #45
Closed
jorgenbruntveit wants to merge 4 commits into
Closed
jorgenbruntveit wants to merge 4 commits into
jorgenbruntveit wants to merge 4 commits into
Conversation
macOS draws some system windows, like SecurityAgent's password prompts, in front of the overlay whatever its level, so the hand was hidden under them while the system cursor was hidden too. Windows in front of the overlay now count like open menus: over them the real cursor shows, even with Keep the hand on, and clicks reach them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The password-prompt fix counted every window listed in front of the overlay as covering it. CleanShot X keeps a full-screen window at a level above the overlay, so the whole screen counted as covered: the real cursor showed everywhere and clicks went through. Only windows macOS draws in front despite a level no higher than the overlay's, like SecurityAgent's prompts, now count. While the overlay is off the active Space during a switch it is not in the window list, so every window counted as in front of it, which made the hand flicker. Nothing counts as covering then. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…vels Council review of the previous commit: activate() scans before the overlay is ordered front, and the Space-switch handler may skip its scan, so a password prompt could go uncounted for up to 250 ms. Both now force a scan on the next tick. A window at the overlay's own level is in front by ordinary ordering, so only lower levels count now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Council round 2: a normal Space switch, where the overlay is already on the new Space, did not force a scan, so a cover there could wait for the 250 ms poll. The reset now runs on both paths, after the re-show tick. 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.
macOS draws some system windows in front of TinyHand's overlay although their window level is lower. The password prompt from SecurityAgent (for example from
do shell script … with administrator privileges, or an installer asking for an admin password) reports layer 1000 but sits in front of the overlay at 1002. While the pointer is on, the hand is drawn underneath the prompt and the system cursor is hidden, so there is nothing to aim with inside it.What it does
CGWindowListCopyWindowInfolists in front of the overlay, with a level lower than the overlay's, now count like open menus: over them the real cursor shows and clicks reach them.How
openMenus(overlay:overlayLevel:)walks the front-to-back window list and also returns windows that come before the overlay's own window, have a lower level and are not owned by TinyHand. It returns those separately as well.updateZonesforces the real cursor when the mouse is over one of those windows.Why the level check
The first version counted every window listed in front of the overlay. CleanShot X keeps an invisible full-screen window at layer 2147483628, above the overlay, so the whole screen counted as covered: the real cursor showed everywhere and clicks went through to apps. During a Space switch the overlay is missing from the on-screen list for a moment, so every window counted and the hand flickered. Both are fixed by the level check and the missing-overlay guard.
Testing
Built with
swift build -c releaseon macOS 27.3. With the pointer on, I opened an admin password prompt withosascript -e 'do shell script "true" with administrator privileges'. The log showed the window being detected, the real cursor each time the mouse went inside the prompt and the hand each time it left. The hand came back as soon as the prompt closed. With CleanShot X running, its full-screen window is no longer counted, and taps, drawing and Space switches work as usual. The password prompt has not been re-tested since the level check was added; its layer (1000) is below the overlay's (1002), so the rule still counts it.Council review
Rounds: 3
🤖 Generated with Claude Code