Skip to content
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

Add option to use Window.requestIdleCallback() for ControlFlow::Poll #3084

Merged

Conversation

daxpedda
Copy link
Member

@daxpedda daxpedda commented Sep 3, 2023

This PR builds on top of #3056 and adds a new extension method on EventLoopWindowTarget to set the strategy for ControlFlow::Poll. By default the Prioritized Task Scheduling API is used, this adds the option to use Window.requestIdleCallback() instead.

Both strategies fallback on setTimeout() when not available.

Cc @GloopShlugger.
Originally implemented in #2880 and then reverted in #3044.
Requires #3056.

@daxpedda daxpedda force-pushed the web-request-idle-callback-2 branch from 577db5f to 43aa7b0 Compare September 3, 2023 19:32
@daxpedda daxpedda mentioned this pull request Sep 3, 2023
25 tasks
@daxpedda daxpedda force-pushed the web-request-idle-callback-2 branch from 43aa7b0 to f1d6191 Compare September 7, 2023 09:49
@daxpedda daxpedda force-pushed the web-request-idle-callback-2 branch from f1d6191 to 53bff7f Compare September 7, 2023 10:01
@daxpedda daxpedda merged commit 83950ac into rust-windowing:master Sep 7, 2023
50 checks passed
kchibisov pushed a commit to kchibisov/winit that referenced this pull request Oct 17, 2023
kchibisov pushed a commit that referenced this pull request Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

1 participant