Skip to content

Commit

Permalink
eframe: don't call App::update on minimized windows (#3877)
Browse files Browse the repository at this point in the history
* Closes #3321
  • Loading branch information
rustbasic authored Jan 25, 2024
1 parent 5388e65 commit e3cfcf7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/eframe/src/native/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ fn run_and_return(

if let Some(window) = winit_app.window(*window_id) {
log::trace!("request_redraw for {window_id:?}");
window.request_redraw();
if !window.is_minimized().unwrap_or(false) {
window.request_redraw();
}
true
} else {
log::trace!("No window found for {window_id:?}");
Expand Down Expand Up @@ -345,7 +347,9 @@ fn run_and_exit(

if let Some(window) = winit_app.window(*window_id) {
log::trace!("request_redraw for {window_id:?}");
window.request_redraw();
if !window.is_minimized().unwrap_or(false) {
window.request_redraw();
}
true
} else {
log::trace!("No window found for {window_id:?}");
Expand Down

0 comments on commit e3cfcf7

Please sign in to comment.