Skip to content

Fix system-wide mouse lag and edge-light CPU usage - #220

Merged
shanselman merged 1 commit into
masterfrom
overlay-cpu-fix
Oct 29, 2026
Merged

shanselman merged 1 commit into
masterfrom
overlay-cpu-fix

Conversation

@shanselman

Copy link
Copy Markdown
Owner

This fixes the system-wide mouse lag and CPU use reported in #214. The app no longer installs a global low-level mouse hook. That hook made every mouse move on the PC wait for our UI thread. Now the app polls the cursor position every 33 ms, and only while the light is on. The blurred glow is cached with BitmapCache, and brightness and the cursor hole are applied outside that cache, so they no longer re-run the full-screen blur. The invisible hover ring is gone.

Measured on a 4-monitor machine, as % of one core: idle is about 0.5–3% (master was 2.5–8%). With the cursor sweeping along the glowing edge it is about 42% (master was 52–58%). Away from the edges it is near zero. The remaining near-edge cost appears to come from redrawing the full-screen see-through overlay window, not the blur. A follow-up could address that.

This is a maintainer patch based on @bruceroberts-mantel's investigation in #214, with co-author credit. Thank you!

Replace the WH_MOUSE_LL hook with a 33 ms GetCursorPos poll that only runs
while the light is on, so other apps' mouse input never waits on our UI thread.
Cache the blurred glow (BitmapCache) and apply brightness and the hover hole
outside the cache, so they no longer re-run the full-screen blur.

Maintainer patch based on the investigation in #214.

Co-authored-by: bruceroberts-mantel <269349613+bruceroberts-mantel@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@shanselman
shanselman merged commit b927edd into master Oct 29, 2026
9 checks passed
@shanselman
shanselman deleted the overlay-cpu-fix branch October 29, 2026 23:55
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