diff --git a/image-sixel.c b/image-sixel.c index f687a51d8..9cd317316 100644 --- a/image-sixel.c +++ b/image-sixel.c @@ -1349,13 +1349,6 @@ sixel_free_output(struct tty *tty, __unused int send) tty->image_data = NULL; } -/* Discard SIXEL output state after a terminal geometry change. */ -void -sixel_geometry_changed(struct tty *tty) -{ - sixel_free_output(tty, !!(tty->flags & TTY_OPENED)); -} - /* Render an image at a terminal's current pixel geometry. */ static struct sixel_image * sixel_render_image(struct image *im, u_int cell_w, u_int cell_h) diff --git a/image.c b/image.c index 1f53a63b5..5ef9dfcc3 100644 --- a/image.c +++ b/image.c @@ -87,16 +87,14 @@ struct image_backend { void (*draw_rect)(struct tty *, const struct image_rect *, const struct tty_style_ctx *); void (*free)(struct tty *, int); - void (*geometry_changed)(struct tty *); }; static const struct image_backend image_backend_ascii = { - "ascii", IMAGE_BACKEND_SCROLLS, NULL, NULL, NULL + "ascii", IMAGE_BACKEND_SCROLLS, NULL, NULL }; static const struct image_backend image_backend_sixel = { "sixel", IMAGE_BACKEND_GRAPHICAL|IMAGE_BACKEND_TEMPORAL, - sixel_draw_rect, - sixel_free_output, sixel_geometry_changed + sixel_draw_rect, sixel_free_output }; /* Compare images by server ID. */ @@ -152,8 +150,8 @@ void image_tty_geometry_changed(struct tty *tty) { image_tty_update(tty); - if (tty->image_backend->geometry_changed != NULL) - tty->image_backend->geometry_changed(tty); + if (tty->image_backend->free != NULL) + tty->image_backend->free(tty, !!(tty->flags & TTY_OPENED)); } /* Free image backend state for a terminal. */ diff --git a/tmux.h b/tmux.h index 638737cd0..2462a5f5f 100644 --- a/tmux.h +++ b/tmux.h @@ -4259,9 +4259,8 @@ void image_rect_get_coords(const struct image_rect *, /* image-sixel.c */ #define SIXEL_COLOUR_REGISTERS 1024 void sixel_draw_rect(struct tty *, - const struct image_rect *, const struct tty_style_ctx *); + const struct image_rect *, const struct tty_style_ctx *); void sixel_free_output(struct tty *, int); -void sixel_geometry_changed(struct tty *); struct sixel_image *sixel_parse(const char *, size_t, u_int, u_int, u_int, u_int); void sixel_free(struct sixel_image *);