mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 23:23:14 -04:00
Use Window.requestIdleCallback()
This commit is contained in:
@@ -442,10 +442,9 @@ impl<T: 'static> Shared<T> {
|
||||
ControlFlow::Poll => {
|
||||
let cloned = self.clone();
|
||||
State::Poll {
|
||||
request: backend::AnimationFrameRequest::new(
|
||||
self.window().clone(),
|
||||
move || cloned.poll(),
|
||||
),
|
||||
request: backend::IdleCallback::new(self.window().clone(), move || {
|
||||
cloned.poll()
|
||||
}),
|
||||
}
|
||||
}
|
||||
ControlFlow::Wait => State::Wait {
|
||||
|
||||
@@ -15,7 +15,7 @@ pub enum State {
|
||||
start: Instant,
|
||||
},
|
||||
Poll {
|
||||
request: backend::AnimationFrameRequest,
|
||||
request: backend::IdleCallback,
|
||||
},
|
||||
Exit,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user