Skip to content

Harden cursor overlay rendering failures#430

Merged
enaboapps merged 1 commit into
mainfrom
agent/fix-overlay-render-failure
Jul 13, 2026
Merged

Harden cursor overlay rendering failures#430
enaboapps merged 1 commit into
mainfrom
agent/fix-overlay-render-failure

Conversation

@enaboapps

Copy link
Copy Markdown
Contributor

What changed

  • contain cursor overlay drawing failures on the overlay thread and disable only overlay rendering for the process
  • stop follow and animation work after failure and emit one sanitized runtime diagnostic
  • cap animation near 30 FPS and avoid invalid or empty repeat arcs
  • guarantee cleanup for partially acquired native drawing resources
  • cover repeat arc bounds and one-shot OutOfMemoryException containment

Root cause

GDI+ surfaced resource exhaustion as OutOfMemoryException from the repeat progress arc. Cursor overlay callbacks were unguarded, so the exception escaped the WinForms message loop and opened the JIT crash dialog.

Impact

Mouse, keyboard, Bluetooth, and command processing continue if the optional cursor overlay fails. The overlay remains disabled until app restart to avoid an allocation retry loop.

Validation

  • focused cursor overlay tests: 28 passed
  • dotnet restore src/SwitchifyPc.sln
  • dotnet build src/SwitchifyPc.sln -c Release --no-restore (0 warnings, 0 errors)
  • dotnet test src/SwitchifyPc.sln -c Release --no-build (433 unit tests and 1 integration test passed)

Closes #429

@enaboapps enaboapps added this to the Release 0.6.2 milestone Jul 13, 2026
@enaboapps
enaboapps marked this pull request as ready for review July 13, 2026 16:35
@enaboapps
enaboapps merged commit 22b6a79 into main Jul 13, 2026
1 check passed
@enaboapps
enaboapps deleted the agent/fix-overlay-render-failure branch July 13, 2026 16:39
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.

Harden cursor overlay rendering failures

2 participants