-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
window.requestAnimationFrame background throttling #1172
Comments
Thanks for the feature request @mavericken! I've added this scenario to our backlog. |
We have the same issue on our end, everything in javascript throttles down and it's extremely annoying as we cannot properly use this webview since eg if we do 3 requests there is a 1 second pause between them instead of just eg ~0.1ms. Here is my reproduction case: |
Do we have any progress on this feature request at the moment? |
I'm distributing a video game using Tauri. I'd like the option to continue simulating the game (running in requestAnimationFrame) even when the window is minimized. |
I'd kindly like to ask if there has been made any progress to this problem? Webkit meanwhile supports this (see https://developer.apple.com/documentation/webkit/wkpreferences/inactiveschedulingpolicy-swift.enum?language=objc) and tauri will be providing a flag soon to set this for each window (which will sadly only work on iOS and macOS, yet). I am experiencing a quite severe issue where websocket connections won't be re-established once a window runs in background (e.g. after minimizing) and the machine goes into sleep mode for a while. Since we're leveraging the mentioned flag on macOS we haven't seen any problems. Solutions like pending WebLock transactions or similar did not help, but I still need to test on windows. Anyways, it should be possible to let developers decide how to handle resources when they're building their apps around browsers that come shipped with the operating system. Otherwise, long running, browser base apps will become extremely hard to manage without ugly workarounds. |
I need an option to ensure that window.requestAnimationFrame does not throttle when my application does not have focus. By the nature of my application, it will normally not have focus but it still needs to be able to render smooth animations. The throttling happens at unexpected times, where it will continue smooth animation for a while after I click away, but minutes later it becomes a slide show until I click the window again.
AB#32524564
The text was updated successfully, but these errors were encountered: