https://gitlab.synchro.net/main/sbbs/-/commit/561cd5b998b75665f085c391
Modified Files:
src/doors/syncconquer/door/door_io.c src/doors/syncdoom/syncdoom.c src/doors/syncduke/syncduke_io.c src/doors/syncmoo1/syncmoo1.h syncmoo1_input.c syncmoo1_io.c src/doors/syncretro/syncretro.h syncretro_input.c syncretro_io.c
Log Message:
doors: size the image to what the terminal will DRAW, not to its window
SyncDOOM (and SyncDuke) rendered all black in an xterm bigger than its default size. The image was fine; xterm was throwing it away whole.
A sixel whose DECLARED raster exceeds the terminal's graphics limit is not clipped -- xterm discards the entire image (graphics_sixel.c, GetExtent: "raster width %d > max %d" -> finished_parsing + return, nothing drawn). The limit is maxGraphicSize, which defaults to 1000x1000. So any window whose canvas is wider than ~1000px got a sixel xterm refused outright, and the
screen stayed black; the default small window stayed under the limit and worked, which is exactly the reported symptom.
And the terminal TELLS us the limit -- we were discarding the answer. XTSMGRAPHICS (ESC[?2;1S) reports Min(window, graphics_max) -- the biggest
sixel it will accept -- and every door already sends the query as part of termgfx_term_probe. But xterm answers BOTH that and ESC[14t, and the doors either preferred the ESC[14t window size or never parsed the graphics reply at all, so they fitted the image to a window the terminal would not draw into.
The graphics geometry is now authoritative in every door that uses termgfx, whichever order the replies arrive in:
SyncDOOM used XTSMGRAPHICS only as a fallback when ESC[14t was silent --
so on xterm it fitted the 1920x1080 window, emitted a 1280x800
sixel, and got it discarded. Now prefers it.
SyncDuke fitted the sixel to the ESC[14t window (syncduke_update_outsize)
even though syncduke_canvas_*() already preferred the graphics
geometry for JXL -- and its OUT_W_MAX is 1024, itself over
xterm's limit. Now fits the canvas.
SyncMOO1 never parsed the reply at all (only ESC[14t). Added, and it
outranks the window.
SyncRetro likewise never parsed it -- and worse, its F4 handler assumed "no
terminal SENDS a CSI S as input", so the XTSMGRAPHICS reply (CSI
? 2;0;W;H S) fell through as an F4 KEYPRESS and silently cycled
the render tier at startup on any terminal that answers it. The
'?' private intro now routes it to the canvas handler instead,
fixing both.
SyncConquer already landed on the right value, but only because the 't'
reply happened to arrive before the 'S' one. Made explicit rather
than left to ordering.
Verified by driving SyncDOOM through a simulated xterm (answering ESC[14t with 1920x1080, ESC[?2;1S with 1000x1000, DA1 with sixel): it now sizes to win=1000x1000 and emits a 1000x625 image, inside the limit. The old code
fitted the window and produced 1280x800 -- discarded.
Pre-existing, not a regression from the recent sixel-scaling work: the width path is unchanged by it. It surfaced now because that work is what got xterm tested at size.
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net