From e2ddef74387bcd81859b56e47316c47d7b739a01 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 12 Jan 2023 05:18:25 +0100 Subject: Replace `Option` with `RedrawRequest` enum --- glutin/src/application.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'glutin/src/application.rs') diff --git a/glutin/src/application.rs b/glutin/src/application.rs index a3cef829..3bb9e61a 100644 --- a/glutin/src/application.rs +++ b/glutin/src/application.rs @@ -270,6 +270,7 @@ async fn run_instance( redraw_pending = matches!( start_cause, event::StartCause::Init + | event::StartCause::Poll | event::StartCause::ResumeTimeReached { .. } ); } @@ -379,8 +380,15 @@ async fn run_instance( let _ = control_sender.start_send(match interface_state { user_interface::State::Updated { - redraw_requested_at: Some(at), - } => ControlFlow::WaitUntil(at), + redraw_request: Some(redraw_request), + } => match redraw_request { + crate::window::RedrawRequest::NextFrame => { + ControlFlow::Poll + } + crate::window::RedrawRequest::At(at) => { + ControlFlow::WaitUntil(at) + } + }, _ => ControlFlow::Wait, }); -- cgit