Instead of redrawing the entire pane or scene when moving or redrawing a

pane, add damage rectangles and redraw only the affected spans. From
Michael Grant.
This commit is contained in:
nicm
2026-10-02 12:48:52 +00:00
committed by tmux update bot
parent 950a7f6631
commit 0a1adfa116
12 changed files with 451 additions and 59 deletions

9
tty.c
View File

@@ -1,4 +1,4 @@
/* $OpenBSD: tty.c,v 1.482 2026/09/22 06:58:06 nicm Exp $ */
/* $OpenBSD: tty.c,v 1.483 2026/10/02 12:48:52 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1110,7 +1110,7 @@ tty_redraw_region(struct tty *tty, const struct tty_ctx *ctx)
*/
if (tty_large_region(tty, ctx) || ctx->flags & TTY_CTX_PANE_OBSCURED) {
log_debug("%s: %s large region redraw", __func__, c->name);
ctx->redraw_cb(ctx);
ctx->redraw_cb(ctx, ctx->orupper, ctx->orlower - ctx->orupper + 1);
return;
}
@@ -1458,6 +1458,7 @@ tty_sync_start(struct tty *tty)
if (tty->flags & TTY_SYNCING)
return;
tty->flags |= TTY_SYNCING;
tty->sync_offset = EVBUFFER_LENGTH(tty->out);
if (tty_term_has(tty->term, TTYC_SYNC)) {
log_debug("%s sync start", tty->client->name);
@@ -1851,7 +1852,7 @@ tty_cmd_alignmenttest(struct tty *tty, const struct tty_ctx *ctx)
u_int i, j;
if (ctx->flags & TTY_CTX_WINDOW_BIGGER) {
ctx->redraw_cb(ctx);
ctx->redraw_cb(ctx, 0, ctx->sy);
return;
}
@@ -1910,7 +1911,7 @@ tty_cmd_cells(struct tty *tty, const struct tty_ctx *ctx)
tty->cy == tty->rlower)
tty_draw_pane(tty, ctx, ctx->ocy);
else
ctx->redraw_cb(ctx);
ctx->redraw_cb(ctx, ctx->ocy, 1);
return;
}