Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Workaround for mouse polling rate bug #7

Merged
merged 2 commits into from
Jul 29, 2020
Merged

Workaround for mouse polling rate bug #7

merged 2 commits into from
Jul 29, 2020

Conversation

xanderfrangos
Copy link
Contributor

I've implemented a window move/resize throttle to avoid mouse polling rate lag when using an acrylic window. The move/resize events on the vBrowserWindow are automatically patched on creation.

There are two issues with this workaround at the moment:

  1. The refresh rate is hard-coded to ~60hz. I've noticed that some displays will still lag even if you go a little above their refresh rate, so I went with the most common refresh rate. High refresh rate displays (ex. 144hz) will have choppy movement when moving/resizing the window. Proper refresh rate detection is needed to move/resize displays at their full rate.
  2. Aero Shake will trigger somewhat randomly. This appears to be a bug with Electron itself. 🙁 A workaround to this would be to temporarily disable Aero Shake through the registry, but that's not a great solution.

Slowed down the rate of window move/resize updates to avoid the mouse polling rate bug with acrylic windows. Unfortunately, there's a bug with 'will-move' which can randomly trigger Aero Shake.
@seo-rii
Copy link
Owner

seo-rii commented Jul 29, 2020

What an amazing optimization method! I've looked up the problem number one, and using the https://github.com/sebhildebrandt/systeminformation module, I think it's possible to get the frame rate. I'm afraid we can't help it until the second problem is solved in Electron:( Anyway, thank you for a good PR!

@seo-rii seo-rii merged commit ce98fd7 into seo-rii:master Jul 29, 2020
@fearganni
Copy link
Contributor

This fix does stop the delayed lag I said I was experiencing in #6.
--after testing:
I just want to mention - this fix doesn't resolve lag when the window resize is only y-axis.

@seo-rii
Copy link
Owner

seo-rii commented Jul 29, 2020

Really? In my case, after applying this PR, the problem of slightly slowing down when resizing has been solved.

@xanderfrangos
Copy link
Contributor Author

I'll be publishing a module soon-ish that will handle everything we need for the refresh rate problem. 👍

@seo-rii seo-rii added the bug Something isn't working label Jan 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants