Describe the bug
When app is hidden behind some other window, it stops updating, even tho request_repaint is called.
To Reproduce
Steps to reproduce the behavior:
- Run this small example:
- Just a hello world with a forced ctx.request_repaint to ensure the app always gets updated
- Each update it prints Updating: {Instant::now()}
use eframe::egui;
use std::time::Instant;
#[derive(Default)]
struct App {
}
impl eframe::App for App {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
println!("Updating: {:?}", Instant::now());
egui::CentralPanel::default().show(ctx, |ui| {
ui.label("Hello world");
});
ctx.request_repaint();
}
}
fn main() {
let options = eframe::NativeOptions {
initial_window_size: Some(egui::vec2(320.0, 240.0)),
..Default::default()
};
eframe::run_native(
"My egui App",
options,
Box::new(|_cc| Box::<App>::default()),
);
}
- Do something that hides the app behind some other window.
- In the terminal where you ran the app, you will see no more prints appearing...
- Try minimizing the app and prints will work
Expected behavior
App should still be updating as request_repaint is called. The behaviour should be the same as when minimizing the window...
Screenshots

- First I minimized the window (Logs are still appearing)
- Then bring it back to foreground
- Then clicked vscode to hide the app, this is where the logs stop!
Desktop (please complete the following information):
- OS: Ubuntu 22.04
- Browser chrome
- Version 112.0.5615.121
Additional context
I did some debugging (not a lot) and I saw that in eframe/src/native/run.rs::run_and_exit (:318..:326) the next_repaint_time is set to extremely_far_future() ? Probably has something to do with this?
*control_flow = if next_repaint_time <= Instant::now() {
if let Some(window) = winit_app.window() {
window.request_redraw();
}
next_repaint_time = extremely_far_future();
ControlFlow::Poll
} else {
ControlFlow::WaitUntil(next_repaint_time)
};
Describe the bug
When app is hidden behind some other window, it stops updating, even tho request_repaint is called.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
App should still be updating as request_repaint is called. The behaviour should be the same as when minimizing the window...
Screenshots
Desktop (please complete the following information):
Additional context
I did some debugging (not a lot) and I saw that in eframe/src/native/run.rs::run_and_exit (:318..:326) the next_repaint_time is set to extremely_far_future() ? Probably has something to do with this?