Repository navigation
Fix system-wide mouse lag and edge-light CPU usage - #220
Merged
Merged
Conversation
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>
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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!