Skip to content

fix(macos): scale remote scroll input using macOS scroll speed#5133

Merged
ReenigneArcher merged 1 commit into
LizardByte:masterfrom
martona:macos-scroll-fix-pr
May 17, 2026
Merged

fix(macos): scale remote scroll input using macOS scroll speed#5133
ReenigneArcher merged 1 commit into
LizardByte:masterfrom
martona:macos-scroll-fix-pr

Conversation

@martona
Copy link
Copy Markdown
Contributor

@martona martona commented May 17, 2026

Description

This fixes macOS remote scrolling being painfully slow in Sunshine.

Moonlight sends wheel deltas in WHEEL_DELTA = 120 units, including high-resolution sub-detent data. Sunshine’s macOS backend was converting that to CoreGraphics line scroll events on an integer basis with 120 -> 1 line, which both ignored high-res scroll granularity and made the macOS Mouse scroll speed setting effectively useless.

This changes macOS scoll behavior the following way:

  • preserve high-resolution scroll input as pixel-unit CoreGraphics scroll events
  • mark scroll events as continuous
  • read com.apple.scrollwheel.scaling from global preferences
  • treat it as the 0..1 Mouse scroll speed slider value
  • map Apple’s default 0.3125 to 5 lines per detent
  • log the raw and derived values at startup

Default scrolling now feels like it's alive, while lower and higher macOS scroll-speed settings still do what you’d expect.

Testing

Was tested with a full build (scripts/build_macos.sh) and verified manually on Tahoe.

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Bundle Report

Bundle size has no change ✅

@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

❌ Patch coverage is 27.02703% with 27 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@15eabb2). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/platform/macos/input.cpp 27.02% 23 Missing and 4 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #5133   +/-   ##
=========================================
  Coverage          ?   17.87%           
=========================================
  Files             ?      111           
  Lines             ?    24093           
  Branches          ?    10649           
=========================================
  Hits              ?     4307           
  Misses            ?    17322           
  Partials          ?     2464           
Flag Coverage Δ
Archlinux 11.23% <ø> (?)
FreeBSD-amd64 13.36% <ø> (?)
Homebrew-ubuntu-22.04 13.58% <ø> (?)
Linux-AppImage 12.15% <ø> (?)
Windows-AMD64 14.89% <ø> (?)
Windows-ARM64 13.22% <ø> (?)
macOS-arm64 19.06% <27.02%> (?)
macOS-x86_64 18.41% <27.02%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/platform/macos/input.cpp 35.31% <27.02%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 15eabb2...7f77c0a. Read the comment docs.

@ReenigneArcher ReenigneArcher merged commit be18f2f into LizardByte:master May 17, 2026
74 checks passed
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.

2 participants