diff options
| author | Ingmar Steen <iksteen@gmail.com> | 2026-09-06 19:41:56 +0200 |
|---|---|---|
| committer | Ingmar Steen <iksteen@gmail.com> | 2026-09-06 19:41:56 +0200 |
| commit | b6fbc2184ff26425e212d88bbb3de04066a9e5f6 (patch) | |
| tree | 49995f79ed0dcf9acca85cedf5cde0aa18e6e508 /src/graphics.c | |
| parent | graphics: place an image once, not once per frame (diff) | |
| download | slosh-b6fbc2184ff26425e212d88bbb3de04066a9e5f6.tar.gz slosh-b6fbc2184ff26425e212d88bbb3de04066a9e5f6.tar.xz slosh-b6fbc2184ff26425e212d88bbb3de04066a9e5f6.zip | |
graphics: state z=0 on a placement, so a mirror paints it over the text
kitty's default z is 0, which draws an image above the text, and that is
the value slosh has always relied on -- it places after the cell diff
precisely so the picture ends up on top. Saying nothing works because
the terminal supplies the default.
Anything mirroring the stream has no such default to fall back on. It
cannot tell "the emitter wants this over the text" from "the emitter
said nothing", and shellglass's viewer paints an unstated image under
the cells. That is fine until a cell over the picture carries an
explicit background -- and dim_unfocused gives one to every cell of a
pane at once, so the moment focus moved elsewhere the whole image
disappeared from the mirrored copy while the terminal, which took the
default, still showed it.
So the placement states z=0. Nothing changes on a terminal, since that
is the value it was already assuming; the mirror now paints the picture
over the cells and the dim pass runs underneath it, where it belongs.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CRz3zwZJvBvzsR9k4cj6dd
Diffstat (limited to 'src/graphics.c')
| -rw-r--r-- | src/graphics.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/graphics.c b/src/graphics.c index 726e564..3330ece 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -342,7 +342,15 @@ char *gfx_flush(graphics_t *g, size_t *out_len) { g->placed[g->nplaced++] = i; p->shown = true; out_fmt(g, "\x1b[%u;%uH", p->row + 1, p->col + 1); - out_fmt(g, "\x1b_Ga=p,q=2,C=1,i=%u,p=%u", p->out_id, p->place_id); + /* z=0 is kitty's own default, so saying it changes nothing on a terminal + * -- and it is the whole picture for anything mirroring the stream, which + * cannot otherwise tell "the emitter wants this over the text" from "the + * emitter said nothing". Left unsaid, a mirror is free to paint the image + * under the cells, and the first pane-wide background to land on those + * cells (dim_unfocused paints one over every cell it touches) hides the + * picture completely -- on the mirrored copy only, while the terminal, + * which took the default, still shows it. */ + out_fmt(g, "\x1b_Ga=p,q=2,C=1,z=0,i=%u,p=%u", p->out_id, p->place_id); /* c=/r= mean *scale into this many cells*, so they are passed on only * when the program asked for them. Sending the cell count a natural-size * image happens to cover looks identical in a still picture and makes a |
