summaryrefslogtreecommitdiffstats
path: root/examples/integration/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/integration/src/main.rs')
-rw-r--r--examples/integration/src/main.rs21
1 files changed, 12 insertions, 9 deletions
diff --git a/examples/integration/src/main.rs b/examples/integration/src/main.rs
index db8b4366..4c4b6d84 100644
--- a/examples/integration/src/main.rs
+++ b/examples/integration/src/main.rs
@@ -119,16 +119,19 @@ pub fn main() {
}
}
Event::MainEventsCleared => {
- // We update iced
- let _ = state.update(
- None,
- viewport.logical_size(),
- &mut renderer,
- &mut debug,
- );
+ // If there are events pending
+ if !state.is_queue_empty() {
+ // We update iced
+ let _ = state.update(
+ None,
+ viewport.logical_size(),
+ &mut renderer,
+ &mut debug,
+ );
- // and request a redraw
- window.request_redraw();
+ // and request a redraw
+ window.request_redraw();
+ }
}
Event::RedrawRequested(_) => {
if resized {