diff --git a/src/main.rs b/src/main.rs index 9d895cd..56a7808 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1938,6 +1938,25 @@ impl App { let geometries = tab.collect_pane_geometries(); let active_pane_id = tab.active_pane; + // Early return: skip rendering if nothing is dirty and no animations + let has_dirty_content = geometries.iter().any(|(pane_id, _)| { + tab.panes + .get(pane_id) + .map(|p| { + let dl = &p.terminal.dirty_lines; + dl[0] != 0 || dl[1] != 0 || dl[2] != 0 || dl[3] != 0 + }) + .unwrap_or(false) + }); + + if !has_dirty_content && self.edge_glows.is_empty() { + let image_animation_in_progress = tab.panes.values().any(|p| { + p.terminal.image_storage.has_animations() + }); + needs_another_frame = image_animation_in_progress; + return needs_another_frame; + } + // First pass: sync images and calculate dim factors (needs mutable access) let mut dim_factors: Vec<(PaneId, f32)> = Vec::new(); for (pane_id, _) in &geometries { diff --git a/src/renderer.rs b/src/renderer.rs index 59eadf5..314fb25 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -2150,10 +2150,6 @@ impl Renderer { let rows = terminal.rows; let total_cells = cols * rows; - // TEMPORARY DEBUG: Force full rebuild every frame to test if dirty-line tracking is the issue - // TODO: Remove this once the rendering bug is fixed - self.cells_dirty = true; - // Check if grid size changed - need full rebuild let size_changed = self.last_grid_size != (cols, rows); if size_changed {