Skip to content

fix(macos): create fresh mouse events for each submission - #183

Merged
ReenigneArcher merged 3 commits into
masterfrom
fix/macos/mouse-lifetime
Nov 21, 2026
Merged

ReenigneArcher merged 3 commits into
masterfrom
fix/macos/mouse-lifetime

Conversation

@ReenigneArcher

Copy link
Copy Markdown
Member

Description

Avoid retaining a CoreGraphics mouse event for the backend lifetime. Preserve movement, button, and modifier metadata while reporting transient event allocation failures.

Add regression coverage for aged cursor snapshots, dragging, modifier flags, and allocation failure recovery.

Screenshot

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

See our AI usage policy.

  • 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

@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.72727% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.60%. Comparing base (d557dd9) to head (77548c5).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/platform/macos/macos_backend.cpp 72.72% 0 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #183      +/-   ##
==========================================
+ Coverage   73.51%   73.60%   +0.09%     
==========================================
  Files          45       45              
  Lines        9895     9892       -3     
  Branches     3692     3690       -2     
==========================================
+ Hits         7274     7281       +7     
- Misses       1994     2230     +236     
+ Partials      627      381     -246     
Flag Coverage Δ
FreeBSD 53.72% <ø> (ø)
Linux-Clang 68.49% <ø> (ø)
Linux-GCC 80.74% <ø> (ø)
PowerShell 78.60% <ø> (ø)
Windows-MSVC 73.49% <ø> (+0.01%) ⬆️
Windows-MinGW-UCRT64 66.20% <ø> (-0.02%) ⬇️
macOS 51.04% <72.72%> (+0.13%) ⬆️

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

Files with missing lines Coverage Δ
src/platform/macos/macos_backend.cpp 63.89% <72.72%> (+2.18%) ⬆️

... and 10 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

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

@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 2026

Copy link
Copy Markdown

Avoid retaining a CoreGraphics mouse event for the backend lifetime. Preserve movement, button, and modifier metadata while reporting transient event allocation failures.

Add regression coverage for aged cursor snapshots, dragging, modifier flags, and allocation failure recovery.
@ReenigneArcher
ReenigneArcher force-pushed the fix/macos/mouse-lifetime branch from cd374a9 to 37f0211 Compare November 21, 2026 02:32

@ReenigneArcher ReenigneArcher left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One correctness issue remains in button-allocation failure recovery; see the inline comment for the reproduction, tested correction, and regression test.

Validation: the macOS Debug library and both examples built; formatting and git diff --check passed; 27 existing macOS backend and gamepad adapter/lifecycle tests passed. The added regression fails on this head and passes with the suggested correction. The suppression behavior from #205 remains covered.

CI is still running. The multi-hour streaming failure reported in Sunshine #5874 was not reproduced; live streaming/device validation remains unverified.

Review completed by Codex | Model: gpt-6.1-sol | Thinking: xhigh

Comment thread src/platform/macos/macos_backend.cpp Resolved
Update drag state and click timing only after a fresh mouse event is
posted. Cover a failed press, a normal move, and a successful retry.
@sonarqubecloud

Copy link
Copy Markdown

@ReenigneArcher
ReenigneArcher merged commit dd8153d into master Nov 21, 2026
35 of 36 checks passed
@ReenigneArcher
ReenigneArcher deleted the fix/macos/mouse-lifetime branch November 21, 2026 03:05
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.

macOS: remote mouse input silently dies after uptime — keyboard survives, fixed by process restart

1 participant