Skip to content

fix(cursor): system cursor swaps off the tick thread (#363) - #364

Merged
Maxaubert merged 1 commit into
mainfrom
fix/363-cursor-off-tick
Oct 4, 2026
Merged

Maxaubert merged 1 commit into
mainfrom
fix/363-cursor-off-tick

Conversation

@Maxaubert

Copy link
Copy Markdown
Owner

Closes #363.

The hitch recorder (#361) traced the zoom-in and zoom-out stutter to the system cursor swaps on the tick thread:

  • Zoom-out restore: SPI_SETCURSORS reloads the whole cursor scheme from disk. 8 ms median, up to 90 ms under load. It froze the 1x landing frame.
  • Blank at zoom-in and mid-zoom: 14 SetSystemCursor calls, about 10 ms (busy in cursor).

Change

  • CursorBlanker runs its swaps in order on a Wind cursor swaps worker thread, at above normal priority.
  • The zoom-out repaint nudge runs on the worker, after the restore.
  • restoreSync() covers the input-panel clip nudge and shutdown. The crash filter is unchanged and still restores directly.
  • The restore still reloads the live scheme, not cached copies, so animated cursors and cursor size changes survive.
  • The txPace=2 composite pulse thread now runs at HIGHEST. Under build load it was starved (pulse-thread-late).
  • Version 0.23.1.

Verified on the signed UIAccess build

  • build.bat test: 569/569 pass. build.bat builds clean.

  • Pointer check: 40 zoom cycles plus 5 in/out storms.

    • While zoomed, the system cursor was blank 40 of 40 times.
    • After every zoom-out the pointer was visible at 30 ms, 150 ms and 500 ms, and after every storm.
  • Zoom-out teardown: 140 zoom-outs.

    Average Max
    Before 9.9 ms 35 ms in run 1, 90 ms in run 2
    After 3.4 ms 5 ms

    busy in cursor and zoom-out busy in activate hitches are gone.

Still open (follow-up)

  • About 8 ms of loop-other between ticks right after a zoom-out. This is likely the message pump reacting to the cursor change, and needs a pump span.
  • Zoom-in blocked in activate, 11 to 14 ms: DWM entering magnification.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KPUNAWcwghXdHCApcKKjSG

…GHEST (#363)

The zoom-out restore (SPI_SETCURSORS scheme reload, 8 ms median, up to 90 ms
under load) and the blank (14 SetSystemCursor) ran on the tick thread and froze
the 1x landing and zoom-in frames. They now run in order on a worker; the
repaint nudge follows the restore there. restoreSync() for the input-panel clip
nudge and shutdown. The txPace=2 composite pulse thread runs at HIGHEST so a
build no longer starves it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KPUNAWcwghXdHCApcKKjSG
@Maxaubert
Maxaubert merged commit 66685d9 into main Oct 4, 2026
1 check passed
@Maxaubert
Maxaubert deleted the fix/363-cursor-off-tick branch October 4, 2026 08:41
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.

Zoom-out and zoom-in hitch: system cursor swaps run on the tick thread

1 participant