Fix up SIXEL with recent changes.

This commit is contained in:
Nicholas Marriott
2026-05-22 12:44:08 +01:00
parent d4255818c4
commit 285a3b7522
3 changed files with 13 additions and 7 deletions

View File

@@ -2463,7 +2463,7 @@ screen_write_sixelimage(struct screen_write_ctx *ctx, struct sixel_image *si,
screen_write_collect_flush(ctx, 0, __func__); screen_write_collect_flush(ctx, 0, __func__);
screen_write_initctx(ctx, &ttyctx, 0); screen_write_initctx(ctx, &ttyctx, 0);
ttyctx.ptr = image_store(s, si); ttyctx.image = image_store(s, si);
tty_write(tty_cmd_sixelimage, &ttyctx); tty_write(tty_cmd_sixelimage, &ttyctx);

4
tmux.h
View File

@@ -1754,6 +1754,10 @@ struct tty_ctx {
const char *data; const char *data;
size_t size; size_t size;
} sel; } sel;
#ifdef ENABLE_SIXEL
struct image *image;
#endif
}; };
/* /*

14
tty.c
View File

@@ -1479,9 +1479,11 @@ tty_set_client_cb(struct tty_ctx *ttyctx, struct client *c)
if (wp->layout_cell == NULL) if (wp->layout_cell == NULL)
return (0); return (0);
/* Set the properties relevant to the current client. */ if (tty_window_offset(&c->tty, &ttyctx->wox, &ttyctx->woy, &ttyctx->wsx,
ttyctx->bigger = tty_window_offset(&c->tty, &ttyctx->wox, &ttyctx->woy, &ttyctx->wsy))
&ttyctx->wsx, &ttyctx->wsy); ttyctx->flags |= TTY_CTX_WINDOW_BIGGER;
else
ttyctx->flags &= ~TTY_CTX_WINDOW_BIGGER;
ttyctx->yoff = ttyctx->ryoff = wp->yoff; ttyctx->yoff = ttyctx->ryoff = wp->yoff;
if (status_at_line(c) == 0) if (status_at_line(c) == 0)
@@ -1510,10 +1512,10 @@ tty_draw_images(struct client *c, struct window_pane *wp, struct screen *s)
ttyctx.sx = wp->sx; ttyctx.sx = wp->sx;
ttyctx.sy = wp->sy; ttyctx.sy = wp->sy;
ttyctx.ptr = im; ttyctx.image = im;
ttyctx.arg = wp; ttyctx.arg = wp;
ttyctx.set_client_cb = tty_set_client_cb; ttyctx.set_client_cb = tty_set_client_cb;
ttyctx.allow_invisible_panes = 1; ttyctx.flags |= TTY_CTX_INVISIBLE_PANES;
tty_write_one(tty_cmd_sixelimage, c, &ttyctx); tty_write_one(tty_cmd_sixelimage, c, &ttyctx);
} }
} }
@@ -2122,7 +2124,7 @@ tty_cmd_rawstring(struct tty *tty, const struct tty_ctx *ctx)
void void
tty_cmd_sixelimage(struct tty *tty, const struct tty_ctx *ctx) tty_cmd_sixelimage(struct tty *tty, const struct tty_ctx *ctx)
{ {
struct image *im = ctx->ptr; struct image *im = ctx->image;
struct sixel_image *si = im->data; struct sixel_image *si = im->data;
struct sixel_image *new; struct sixel_image *new;
char *data; char *data;