Skip to content

Fix ToDesk remote scroll passthrough - #936

Open
ZHOUSJ6 wants to merge 11 commits into
Caldis:masterfrom
ZHOUSJ6:fix/todesk-remote-scroll
Open

Fix ToDesk remote scroll passthrough#936
ZHOUSJ6 wants to merge 11 commits into
Caldis:masterfrom
ZHOUSJ6:fix/todesk-remote-scroll

Conversation

@ZHOUSJ6

@ZHOUSJ6 ZHOUSJ6 commented May 3, 2026

Copy link
Copy Markdown

Summary

  • Detect ToDesk remote-control processes and bundle identifiers.
  • Disable Mos smooth-scroll synthesis for ToDesk remote sessions so raw wheel events keep working.
  • Preserve existing raw-event behavior such as reverse scrolling, and add coverage for ToDesk detection.

Verification

  • DEVELOPER_DIR=\"/Applications/Xcode.app/Contents/Developer\" xcodebuild test -project \"Mos.xcodeproj\" -scheme \"Debug\" -configuration Debug -destination \"platform=macOS\" CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY=\"\"
  • 339 tests passed, 3 skipped, 0 failures.

ZHOUSJ6 and others added 11 commits May 3, 2026 12:24
Cursor routes wheel events through Helper processes, so exception matching and CGEventPostToPid never reached the host app.

Co-authored-by: Cursor <cursoragent@cursor.com>
Cursor treats Mos's continuous pixel events as trackpad input and flips them again, so keep the visual direction aligned with other apps.

Co-authored-by: Cursor <cursoragent@cursor.com>
Point updates at the ZHOUSJ6/Mos sparkle-feed release and sign archives with a fork-owned EdDSA key instead of the upstream Caldis feed.

Co-authored-by: Cursor <cursoragent@cursor.com>
Electron reverse compensation was re-enabling invert after ToDesk passthrough forced reverse off.

Co-authored-by: Cursor <cursoragent@cursor.com>
…dency

Cursor's renderer helpers may be missing from LaunchServices, making
NSRunningApplication(processIdentifier:) return nil. Scroll events were
then posted back to the renderer PID where they vanish. Resolve the host
main process through proc_pidpath + the parent-PID chain (pure kernel
calls, ~4us) and cache the result per target PID so the per-event hot
path never performs IPC again.

Co-authored-by: Cursor <cursoragent@cursor.com>
Cursor's bundle ID starts with "com.todesktop." (the ToDesktop Electron
packaging platform), which contains the "todesk" remote-control keyword.
Once host resolution started working again, Cursor was treated as a
ToDesk remote session and smooth scrolling was forcibly bypassed.
Exclude the com.todesktop. prefix from ToDesk keyword matching while
keeping real ToDesk bundles (com.youqu.todesk etc.) detected.

Co-authored-by: Cursor <cursoragent@cursor.com>
The "Electron extra inversion" was a misdiagnosis: Cursor scrolling
looked reversed only because the todesk keyword misclassification kept
forcing reverse off for it. With that fixed, the compensation now
cancels the user's reverse setting inside Cursor, flipping it relative
to every other app. Remove the compensation so Cursor follows the same
reverse settings as everything else; remote sessions still force raw
direction via useRawScrollForRemoteControl.

Co-authored-by: Cursor <cursoragent@cursor.com>
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