fix(macos): write the scroll point delta last so pixel precision survives - #1156
Open
isleofgreg wants to merge 1 commit into
Open
fix(macos): write the scroll point delta last so pixel precision survives#1156isleofgreg wants to merge 1 commit into
isleofgreg wants to merge 1 commit into
Conversation
…ives A scroll CGEvent keeps one canonical distance. set_continuous_axis wrote the pixel/point delta first and the coarse integer line field after it, which made the line count canonical: at delivery the point delta is re-derived from it at 8 points per line, so every smooth-scroll frame under 10 posted points reached applications as zero and the rest quantized to 8-point steps. Measured on macOS 15.7 (MX Master 4, free-spin): a slow animated stream lost 77% of its distance, a medium one 45%. Writing the point delta last keeps it authoritative. Verified with isolated synthetic-event experiments that the mangle follows field write order, not the posting location. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Greptile SummaryThis PR fixes precision loss in macOS continuous scrolling by writing the Core Graphics point-delta field after the coarser line and fixed-point fields.
Confidence Score: 5/5The PR appears safe to merge, with the narrowly scoped field-order change matching the documented Core Graphics behavior and hardware verification. The changed helper still populates all three scroll representations but now writes the precise point delta last, preventing the subsequently delivered event from being canonicalized to the coarse line value.
|
| Filename | Overview |
|---|---|
| crates/openlogi-inject/src/inject/macos.rs | Reorders continuous-scroll field assignment to preserve pixel precision; no actionable defect was identified. |
Reviews (1): Last reviewed commit: "fix(macos): write the scroll point delta..." | Re-trigger Greptile
This was referenced Sep 4, 2026
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.
Summary
Hardware-verification follow-up to #1141 (first of the fix series proposed there).
A scroll
CGEventkeeps one canonical distance.set_continuous_axiswrites the pixel/point delta first and the coarse integer line field after it, which makes the line count canonical: at delivery the point delta is re-derived from it at 8 points per line. Every smooth-scroll frame under 10 posted points reaches applications as zero, and the rest quantize to 8-point steps.Measured on macOS 15.7 (MX Master 4, free-spin wheel, listen-only session-tap logger): a slow animated stream lost 77% of its distance, a medium one 45%. This is most of the reason
smooth_scroll = truecurrently travels less than native (#1141's 0.58× number).The fix is a reorder: write the line and fixed-point fields first, the point delta last, so it stays authoritative. Verified with isolated synthetic-event experiments that the mangle follows field write order, not posting location (HID vs session tap both show it when the line field is written last).
Test plan
cargo fmt --all --check,cargo clippy -p openlogi-inject --all-targets -- -D warnings(aarch64-darwin + x86_64-pc-windows-gnu),cargo test -p openlogi-inject,cargo check --workspace— all green.🤖 Generated with Claude Code