Request a redraw only on relevant events

This commit is contained in:
Héctor Ramón Jiménez 2020-06-09 15:45:57 +02:00
parent c0a5dc980e
commit 49dbf2c146
4 changed files with 27 additions and 13 deletions

View file

@ -150,6 +150,10 @@ pub fn run<A, E, C>(
event_loop.run(move |event, _, control_flow| match event {
event::Event::MainEventsCleared => {
if state.is_queue_empty() {
return;
}
let command = runtime.enter(|| {
state.update(
clipboard.as_ref().map(|c| c as _),