Repository navigation
fix(agent): follow the pointer again after a shortcut it never saw move; a menu bar glyph 1x can draw - #20
Merged
Merged
Conversation
Control-Command-1 to 9 hands the window it focuses a hold: focus stays there until the pointer travels to another window and rests on it. The same keystroke starts the typing cooldown, and for that half second no tick is allowed to look at the pointer -- long enough to cross to another screen, or to leave the window it was on and come back. Both left focus stuck. A pointer that arrived while nothing was looking was at rest by the time anything looked, which read as a window arriving under a still pointer rather than an entry; and a pointer that came back to the window it set out from was on the one window the hold could never be overruled by. A hold now remembers where the pointer was and the frame it was in, and every tick folds in the pointer's position whether or not that tick may act on it. Leaving the frame spends the anchor for good, so coming back is an arrival like any other, and travel between two decisions counts as travel even when no tick watched it happen. A window arriving under a pointer that has not moved still cannot take focus: that evidence is spent on the one contest it explains, and a hold declared with the pointer already outside the anchor is born spent rather than exempting a window the pointer had left.
cursorarrow.rays draws a half-size pointer inside its box to leave room for the rays, which on a 1x display is an eight-pixel arrow behind one-pixel rays: a smudge on the 1080p screen while looking correct on the Retina one beside it. cursorarrow.motionlines keeps the pointer full size and says the same thing, and it is now what the menu bar and the app icon both draw. The symbol is also left at the size AppKit ships it. Sizing it by hand leaves the alignment rect behind -- the rect is 9 points of an 18 point image -- and the status item is laid out for the tallest menu bar on the system, so the glyph was drawn off centre and clipped in the shorter bar of an external display.
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.
Control-Command-1 to 9 hands the window it focuses a hold: focus stays there until the pointer travels to another window and rests on it. The same keystroke starts the typing cooldown, and for that half second no tick is allowed to look at the pointer -- long enough to cross to another screen, or to leave the window the pointer was on and come back. Both left focus stuck on the window the shortcut chose.
A pointer that arrived while nothing was looking was already at rest by the time anything looked, which read as a window arriving under a still pointer rather than as an entry, and the contest was dropped. A pointer that went out and came back landed on the anchor -- the one window a hold can never be overruled by -- so it held for good.
A hold now remembers where the pointer was and the frame it was in, and every tick folds in the pointer's position whether or not that tick may act on it. Leaving the frame spends the anchor for good, so coming back is an arrival like any other, and travel between two decisions counts as travel even when no tick watched it happen.
A window arriving under a pointer that has not moved still cannot take focus. That was the point of asking for movement in the first place, so the evidence of unwatched travel is spent on the one contest it explains; a hold declared with the pointer already outside the anchor is born spent rather than exempting a window the pointer had left; and movement that never leaves the anchor is measured from, not treated as, travel.
Two known edges, both benign and both left alone: a window dragged out from under a stationary pointer takes its frame with it and the saved one goes stale, which spends the anchor early and lets focus follow the pointer to the window it is on; and an excursion onto a window that overlaps the anchor, without leaving the anchor's own rectangle, is invisible while decisions are suppressed, so the hold stands as it did before.
The menu bar glyph is
cursorarrow.motionlinesrather thancursorarrow.rays. The rays draw a half-size pointer inside their box, which on a 1x display is an eight-pixel arrow behind one-pixel rays -- a smudge on the 1080p screen while looking correct on the Retina one beside it. The symbol is also left at the size AppKit ships it: sizing it by hand leaves the alignment rect behind, and the status item is laid out for the tallest menu bar on the system, so the glyph was drawn off centre and clipped in the shorter bar of an external display. The app icon follows the same symbol.Tested by driving the pointer and the shortcuts with posted events against the running agent: the reported sequence now releases and follows, while the hold still survives a pointer that never leaves its window, a Cmd-Tab handover, and the step shortcuts. 190 unit tests, with the new ones checked against the unfixed code first.