diff --git a/src/main.rs b/src/main.rs index 6b8b4f1..ae1d442 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,6 +29,7 @@ const MAX_FPS: f32 = 30.0; const DISPLAY_PATH_DEPTH: usize = 3; const MAX_TABS: usize = 20; const MAX_PROJECT_COLUMNS: usize = 8; +const RUNNING_COMMAND_REFRESH_DELAY: f32 = 0.2; fn main() -> Result<(), eframe::Error> { let icon_data = core::load_icon().unwrap_or_default(); @@ -265,9 +266,9 @@ impl eframe::App for Calcifer { self.time_watch[6] = watch.elapsed().as_micros() as f32 / 1000.0; - if self.running_command { + if self.running_command && !ctx.input(|i| i.wants_repaint()) { + thread::sleep(time::Duration::from_secs_f32(RUNNING_COMMAND_REFRESH_DELAY)); egui::Context::request_repaint(ctx); - //thread::sleep(time::Duration::from_secs_f32(RUNNING_COMMAND_REFRESH)); } }