Prevent Joy-Con pointer jumps when surface tracking resumes - #63
Merged
Merged
Conversation
An initial lifted report or rejected surface sample must not seed the next valid delta. Drop the optical counter baseline and fractional residue when tracking is unusable, then use the first valid report only to rearm. Ordinary tracked counter wrapping and button ownership remain unchanged. Add regressions for both Joy-Con halves, initial contact, lift, out-of-range distance, poor quality, counter jumps/wrap and residual clearing. They fail on the preceding MouseController and pass with the correction. All existing assertions are retained. This affects the opt-in dashboard pointer adapter only; no core, native SDL, protocol, permissions or packaging change. Locally verified on Linux with Swift 6.2.1 and faked CGEvent posting; native Apple-SDK CI and physical acceptance remain distinct.
This was referenced Sep 17, 2026
jmonster
marked this pull request as ready for review
September 18, 2026 00:38
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.
Joy-Con optical reacquisition fix
Head:
237f7b5fc9042c0552d7b873bef944251bf4b2ec. Ready for review; all seven workflows for this unchanged head passed. Draft status has been removed. No PR merge or force-push was performed.The opt-in dashboard mouse adapter retained a primed optical counter baseline through lift-off, out-of-range lift distance and unusable surface quality. It also primed on an initial no-surface report. A following valid report could turn an untracked counter jump into cursor movement.
Invalidate the baseline and fractional residue on rejected surface reports. The first usable report only rearms; subsequent reports retain modulo-65536 delta conversion. Both Joy-Con halves are covered. Button ownership, valid tracked movement, permission behavior and existing test assertions are retained.
Only
Sources/Switch2KitApp/Output/MouseController.swiftand its boundary tests change. No controller protocol, Swift/C ABI, native SDL/emulator, signing, packaging or permission change.Exact-head CI
These are the workflows that ran for the unchanged head, not a claim that the newer Linux workflow ran on this older branch. The completion audit found no review comments, submitted change-request reviews or unresolved review threads.
Validation
The original regression failed against the preceding production source and passed with the fix. Coverage includes both Joy-Con halves, all three rejection conditions, initial contact, counter jumps/wrap and clearing fractional residue. Complete retained regressions, package build, 82 debug and 82 release package tests with warnings as errors, and whitespace checks passed in the original local run. The downloaded CI source archive matches the published head's complete tree and executable modes.
Additional completion validation combined current main
a187693b8ced4328758c4e242a4eb203d26608a2with #63, #64, corrected #65 (4fef3dc) and corrected #68 (9757016). The local combined tree isfa80b2e7eab3dfadc3196e73c01c9d59079b1422; it was not published or merged.libandlib64, two real C++ consumers and missing-library negative controls: PASS.Pointer tests compile production logic with fake event creation/posting. They do not establish actual desktop pointer behavior or physical optical quality. The cross-PR tests also use synthetic controller data/profiles; physical Bluetooth/gameplay acceptance remains separate.