mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
render: only explicitly re-render old cursor cell if it isn't dirty
If it is dirty, it will be rendered in the normal rendering process.
This commit is contained in:
parent
3b36fb9d74
commit
20af289759
1 changed files with 11 additions and 13 deletions
24
render.c
24
render.c
|
|
@ -374,20 +374,18 @@ grid_render(struct terminal *term)
|
|||
|
||||
/* Erase old cursor (if we rendered a cursor last time) */
|
||||
if (term->render.last_cursor.cell != NULL) {
|
||||
struct cell *hack = (struct cell *)term->render.last_cursor.cell;
|
||||
hack->attrs.clean = 0;
|
||||
render_cell(
|
||||
term, buf, 0,
|
||||
//term->render.last_cursor.cell,
|
||||
hack,
|
||||
term->render.last_cursor.in_view.col,
|
||||
term->render.last_cursor.in_view.row, false);
|
||||
struct cell *cell = term->render.last_cursor.cell;
|
||||
struct coord at = term->render.last_cursor.in_view;
|
||||
|
||||
wl_surface_damage_buffer(
|
||||
term->wl.surface,
|
||||
term->render.last_cursor.in_view.col * term->cell_width,
|
||||
term->render.last_cursor.in_view.row * term->cell_height,
|
||||
term->cell_width, term->cell_height);
|
||||
if (cell->attrs.clean) {
|
||||
cell->attrs.clean = 0;
|
||||
render_cell(term, buf, 0, cell, at.col, at.row, false);
|
||||
|
||||
wl_surface_damage_buffer(
|
||||
term->wl.surface,
|
||||
at.col * term->cell_width, at.row * term->cell_height,
|
||||
term->cell_width, term->cell_height);
|
||||
}
|
||||
term->render.last_cursor.cell = NULL;
|
||||
|
||||
if (term->render.last_cursor.actual.col != term->cursor.col ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue