mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-23 22:01:31 +11:00
In control_flow example, don't schedule a new WaitUntil if wait was cancelled (#1482)
This commit is contained in:
parent
ece2e70a53
commit
b8326f6452
|
@ -100,7 +100,13 @@ fn main() {
|
|||
Event::RedrawEventsCleared => {
|
||||
*control_flow = match mode {
|
||||
Mode::Wait => ControlFlow::Wait,
|
||||
Mode::WaitUntil => ControlFlow::WaitUntil(time::Instant::now() + WAIT_TIME),
|
||||
Mode::WaitUntil => {
|
||||
if wait_cancelled {
|
||||
*control_flow
|
||||
} else {
|
||||
ControlFlow::WaitUntil(time::Instant::now() + WAIT_TIME)
|
||||
}
|
||||
}
|
||||
Mode::Poll => {
|
||||
thread::sleep(POLL_SLEEP_TIME);
|
||||
ControlFlow::Poll
|
||||
|
|
Loading…
Reference in a new issue