Skip to content

fix: keep macOS cursor visible after keyboard input#5350

Open
onlyless wants to merge 1 commit into
LizardByte:masterfrom
onlyless:fix/macos-cursor-after-keyboard
Open

fix: keep macOS cursor visible after keyboard input#5350
onlyless wants to merge 1 commit into
LizardByte:masterfrom
onlyless:fix/macos-cursor-after-keyboard

Conversation

@onlyless

Copy link
Copy Markdown

Description

This change improves macOS remote desktop cursor behavior after keyboard input.

On macOS, the system may hide the cursor while typing. In Moonlight/Sunshine remote desktop sessions, the cursor can remain hidden until a large mouse movement is sent. The macOS input backend now nudges the cursor visible after keyboard input by:

  • associating mouse movement with cursor position
  • showing the cursor for the current display
  • posting a zero-delta mouse moved event at the current cursor position

The existing streaming loop also now has a macOS implementation for enable_mouse_keys() that keeps cursor association/display visibility refreshed while streaming.

Screenshot

N/A

Issues Fixed or Closed

N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code where needed
  • I have tested my changes
  • I have updated documentation where needed
  • I have added tests that prove my fix is effective or that my feature works

Test Plan

  • env npm_config_cache=/private/tmp/sunshine-npm-cache cmake --build cmake-build-macos-check --target test_sunshine sunshine
  • env HOME=/private/tmp/sunshine-test-home XDG_CONFIG_HOME=/private/tmp/sunshine-test-home/.config cmake-build-macos-check/tests/test_sunshine --gtest_color=yes '--gtest_filter=-AVAudioTest.*:AVAudioTest/*:Configurations/AudioTest.*:MouseInputs/MouseHIDTest.*:EncoderVariants/EncoderTest.*'
  • Manual validation on Apple Silicon Mac mini with Moonlight client: cursor returns after keyboard input and streaming remains functional

@sonarqubecloud

Copy link
Copy Markdown

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