diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2025-08-31 08:25:17 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2025-08-31 08:25:17 +0000 |
| commit | 265c93c4c4199fa131476fdbd9eacb9d2fcf51c6 (patch) | |
| tree | 9a55789a86d7cd06d6dc59a00979402c78839f74 /terminal.c | |
| parent | render: dirty all multi-cursor cells *after* rendering a frame (diff) | |
multi-cursor: refactor: add function for dirtying/damaging all multi-cursors
Diffstat (limited to 'terminal.c')
| -rw-r--r-- | terminal.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -2568,6 +2568,29 @@ term_damage_cursor(struct terminal *term) } void +term_damage_all_multi_cursors(struct terminal *term) +{ + if (likely(term->multi_cursor.shapes == NULL)) + return; + + int rect_count = 0; + const pixman_box32_t *boxes = + pixman_region32_rectangles(&term->multi_cursor.active, &rect_count); + + for (const pixman_box32_t *box = boxes; box < &boxes[rect_count]; box++) { + for (int r = box->y1; r < box->y2; r++) { + struct row *row = grid_row(term->grid, r); + xassert(row != NULL); + + row->dirty = true; + + for (struct cell *c = &row->cells[box->x1]; c < &row->cells[box->x2]; c++) + c->attrs.clean = false; + } + } +} + +void term_damage_margins(struct terminal *term) { term->render.margins = true; |
