diff --git a/crates/eframe/src/native/run.rs b/crates/eframe/src/native/run.rs index 28aad0420b0..896d640de36 100644 --- a/crates/eframe/src/native/run.rs +++ b/crates/eframe/src/native/run.rs @@ -192,10 +192,13 @@ fn run_and_return( if let Some(window) = winit_app.window(*window_id) { log::trace!("request_redraw for {window_id:?}"); - if !window.is_minimized().unwrap_or(false) { + let is_minimized = window.is_minimized().unwrap_or(false); + if is_minimized { + false + } else { window.request_redraw(); + true } - true } else { log::trace!("No window found for {window_id:?}"); false @@ -347,10 +350,13 @@ fn run_and_exit( if let Some(window) = winit_app.window(*window_id) { log::trace!("request_redraw for {window_id:?}"); - if !window.is_minimized().unwrap_or(false) { + let is_minimized = window.is_minimized().unwrap_or(false); + if is_minimized { + false + } else { window.request_redraw(); + true } - true } else { log::trace!("No window found for {window_id:?}"); false