aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-08-31 08:25:17 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-08-31 08:25:17 +0000
commit265c93c4c4199fa131476fdbd9eacb9d2fcf51c6 (patch)
tree9a55789a86d7cd06d6dc59a00979402c78839f74 /terminal.c
parentrender: 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.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/terminal.c b/terminal.c
index fe21cfd2..e8a25061 100644
--- a/terminal.c
+++ b/terminal.c
@@ -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;