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

18
tmux.h
View File

@@ -1,4 +1,4 @@
/* $OpenBSD: tmux.h,v 1.1450 2026/10/02 12:28:07 nicm Exp $ */
/* $OpenBSD: tmux.h,v 1.1451 2026/10/02 12:48:52 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -68,6 +68,7 @@ struct options_array_item;
struct options_entry;
struct prompt;
struct window_pane_prompt;
struct redraw_damage;
struct redraw_scene;
struct redraw_span;
struct screen_write_citem;
@@ -1372,6 +1373,7 @@ struct window_pane {
struct screen base;
struct screen status_screen;
u_int status_generation;
TAILQ_HEAD(, window_mode_entry) modes;
@@ -1402,6 +1404,7 @@ struct window_pane {
TAILQ_HEAD(window_panes, window_pane);
TAILQ_HEAD(window_panes_zindex, window_pane);
RB_HEAD(window_pane_tree, window_pane);
TAILQ_HEAD(redraw_damages, redraw_damage);
/* Window structure. */
struct window {
@@ -1445,6 +1448,9 @@ struct window {
uint64_t redraw_scene_generation;
struct redraw_damages damage;
u_int damage_count;
struct menu_data *menu;
u_int menu_last_px;
u_int menu_last_py;
@@ -1767,6 +1773,8 @@ struct tty {
struct event timer;
size_t discarded;
size_t sync_offset;
struct termios tio;
struct grid_cell cell;
@@ -1814,7 +1822,7 @@ struct tty {
};
/* Terminal command context. */
typedef void (*tty_ctx_redraw_cb)(const struct tty_ctx *);
typedef void (*tty_ctx_redraw_cb)(const struct tty_ctx *, u_int, u_int);
typedef int (*tty_ctx_set_client_cb)(struct tty_ctx *, struct client *);
struct tty_ctx {
struct screen *s;
@@ -3589,8 +3597,12 @@ void redraw_screen(struct client *);
void redraw_pane(struct client *, struct window_pane *);
void redraw_pane_scrollbar(struct client *, struct window_pane *);
void redraw_free_scene(struct redraw_scene *);
int redraw_client_has_window(struct client *, struct window *);
void redraw_invalidate_scene(struct window *);
void redraw_invalidate_all_scenes(void);
void redraw_damage_window(struct window *, u_int, u_int, u_int, u_int);
void redraw_free_damage(struct window *);
void redraw_client_damage(struct client *);
int redraw_get_status_border_cell_type(struct redraw_span **, u_int);
/* screen.c */
@@ -3767,6 +3779,8 @@ struct style_range *window_pane_status_get_range(struct window_pane *, u_int,
u_int);
int window_pane_is_floating(struct window_pane *);
int window_pane_is_floating_with_hidden(struct window_pane *);
void window_redraw_floating_pane(struct window_pane *, int, int,
int, int);
/* window-border.c */
void window_set_fill_cells(struct window *);