Replace Option<Instant> with RedrawRequest enum
This commit is contained in:
parent
502c9bfbf6
commit
e2ddef7438
8 changed files with 84 additions and 31 deletions
|
|
@ -332,6 +332,7 @@ async fn run_instance<A, E, C>(
|
|||
redraw_pending = matches!(
|
||||
start_cause,
|
||||
event::StartCause::Init
|
||||
| event::StartCause::Poll
|
||||
| event::StartCause::ResumeTimeReached { .. }
|
||||
);
|
||||
}
|
||||
|
|
@ -440,8 +441,15 @@ async fn run_instance<A, E, C>(
|
|||
|
||||
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,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
use crate::command::{self, Command};
|
||||
use iced_native::window;
|
||||
|
||||
pub use window::{frames, Event, Mode, UserAttention};
|
||||
pub use window::{frames, Event, Mode, RedrawRequest, UserAttention};
|
||||
|
||||
/// Closes the current window and exits the application.
|
||||
pub fn close<Message>() -> Command<Message> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue