main: no need to damage the _entire_ view on blink timer

This commit is contained in:
Daniel Eklöf 2019-07-21 20:15:18 +02:00
parent e21ab8cf33
commit c1381fbb54
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

12
main.c
View file

@ -812,7 +812,17 @@ main(int argc, char *const *argv)
term.blink_mode = term.blink_mode == BLINK_ON
? BLINK_OFF : BLINK_ON;
term_damage_view(&term);
/* Scan all visible cells and mark rows with blinking cells dirty */
for (int r = 0; r < term.rows; r++) {
struct row *row = grid_row_in_view(term.grid, r);
for (int col = 0; col < term.cols; col++) {
if (row->cells[col].attrs.blink) {
row->dirty = true;
break;
}
}
}
if (term.frame_callback == NULL)
grid_render(&term);