feat(macos): add software scroll inversion fallback - #524
Open
zinego wants to merge 6 commits into
Open
Conversation
zinego
marked this pull request as ready for review
August 7, 2026 06:03
Greptile SummaryThe PR adds a per-device macOS software fallback for mice that lack native HID++ scroll inversion while preserving the native path and leaving unmatched or ambiguous input unchanged.
Confidence Score: 5/5The PR appears safe to merge with no concrete blocking or independently actionable non-blocking issues identified. The fallback fails open for unknown or ambiguous identities, excludes native-capable devices from software inversion, preserves trackpad and horizontal scrolling paths, and safely replaces matched macOS scroll events.
|
| Filename | Overview |
|---|---|
| crates/openlogi-hook/src/macos.rs | Adds a copy-and-replace scroll transformation that preserves metadata and horizontal deltas while preventing synthetic-event re-entry. |
| crates/openlogi-agent-core/src/hook_runtime.rs | Adds conservative per-device identity matching and the runtime policy for applying software inversion only to eligible mouse-wheel events. |
| crates/openlogi-agent-core/src/orchestrator.rs | Publishes software inversion identities for non-native pointer devices and suppresses unsafe shared-receiver attribution. |
| crates/openlogi-gui/src/state.rs | Enables inversion for persistent macOS pointer devices while retaining separate native-capability reporting. |
| crates/openlogi-gui/src/app/detail.rs | Selects distinct explanatory text for native inversion, software fallback, and unsupported devices. |
Sequence Diagram
sequenceDiagram
participant Mouse as Physical mouse
participant Hook as macOS event tap
participant Map as Software inversion lookup
participant OS as macOS application
Mouse->>Hook: Scroll event + sender identity
Hook->>Map: Match vendor/product or safe name
alt Matched fallback with inversion enabled
Map-->>Hook: Invert
Hook->>Hook: Copy event, negate vertical deltas, mark synthetic
Hook->>OS: Replacement scroll event
else Native, disabled, unknown, ambiguous, or trackpad
Map-->>Hook: Pass through
Hook->>OS: Original scroll event
end
Reviews (1): Last reviewed commit: "docs(scroll): document macos inversion f..." | Re-trigger Greptile
Collaborator
|
@zinego Can you please rebase and get the tests working on the PR? |
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
Add a per-device macOS software fallback for scroll inversion when a persistent pointer device, such as the Signature M650, does not expose native HID++
0x2121inversion support.The native capability remains authoritative. Devices that support native inversion continue using HID++, while unsupported devices can invert vertical wheel events through the existing macOS event tap without changing trackpad scrolling.
Changes
hook
agent
gui
docs
Testing
Passed locally:
cargo fmt --all -- --checkcargo clippy -p openlogi-hook -p openlogi-agent-core -p openlogi-agent --all-targets -- -D warningscargo test -p openlogi-hook -p openlogi-agent-core -p openlogi-agentAttempted locally but blocked by the host toolchain:
cargo clippy --workspace --all-targets -- -D warningscargo test --workspaceBoth full-workspace commands reached
gpui_macosand then stopped because this Mac has Command Line Tools but not Xcode's optionalmetalcompiler. CI remains the authoritative full-workspace and cross-platform check.Hardware validation:
Screenshot: pending final GUI capture.
Fixes: N/A — no matching issue is currently filed.