fix(track): caret follows right after app switches; Java carets via getCaretLocation (#365) - #366
Merged
Merged
Conversation
…a caret via getCaretLocation (#365) A focus event for the control that already has focus (same foreground window, focus window and element bounds) no longer re-baselines the caret, so typing right after an app switch is followed. Java carets come from the bridge's getCaretLocation scaled by the monitor DPI; the character bounds gave x=2 for every Swing caret. trackLog names the bridge call and caret index. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPUNAWcwghXdHCApcKKjSG
Maxaubert
force-pushed
the
fix/365-caret-switch-java
branch
from
October 4, 2026 08:37
ab27217 to
4c822a3
Compare
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 #365. Stacked on #364; GitHub retargets it to main when #364 merges.
1. App-switch gap.
src/focus_identity.h, unit-tested;focus repeatin trackLog).2. Java carets.
getAccessibleTextRect) gave x=2 for every Swing caret, with y pinned to the top or bottom of the view.getCaretLocation, scaled by the monitor DPI, because Java answers in its user space. The old call stays as a fallback.Verified on the signed UIAccess build (scripted runs; trackLog plus ground truth)
For Swing, the remaining 15 reads are jumps across a 400-character line, where the app logged the caret position before it scrolled.
build.bat test: 572/572 pass.Not fixed here
Version 0.23.2.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KPUNAWcwghXdHCApcKKjSG