Skip to content

Prevent Joy-Con pointer jumps when surface tracking resumes - #63

Merged
jmonster merged 1 commit into
mainfrom
fix/joycon-pointer-reacquisition
Sep 18, 2026
Merged

jmonster merged 1 commit into
mainfrom
fix/joycon-pointer-reacquisition

Conversation

@jmonster

@jmonster jmonster commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

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.swift and its boundary tests change. No controller protocol, Swift/C ABI, native SDL/emulator, signing, packaging or permission change.

Exact-head CI

Workflow Result
macOS package/regressions/app/demo PASS
Swift source/native C distribution PASS
Real SDL3 native consumers PASS
Swift concurrency PASS
SDL regressions PASS
Packaged runtime PASS
Emulator integration PASS

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 a187693b8ced4328758c4e242a4eb203d26608a2 with #63, #64, corrected #65 (4fef3dc) and corrected #68 (9757016). The local combined tree is fa80b2e7eab3dfadc3196e73c01c9d59079b1422; it was not published or merged.

  • Complete retained regression suite: PASS, including the pointer-boundary tests and 20 isolated BlueZ scenarios.
  • Package tests with warnings as errors: 92 debug and 92 release PASS.
  • Real SDL 3.4.16/native host suite, including pinned Cemu and Dolphin motion processors: 8/8 PASS.
  • Native facade relocation with lib and lib64, two real C++ consumers and missing-library negative controls: PASS.
  • Forty additional release BlueZ transition cases and a separate all-four-model BlueZ → actual C ABI/SDL → pinned Cemu motion harness: PASS. These are additional local checks, not new committed CI tests or physical measurements.

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.

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.
@jmonster
jmonster marked this pull request as ready for review September 18, 2026 00:38
@jmonster
jmonster merged commit 655fec6 into main Sep 18, 2026
19 checks passed
@jmonster
jmonster deleted the fix/joycon-pointer-reacquisition branch September 18, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant