Merge screen-anchored render-grid export with main's lease rotation
Merges the screen-anchored render-grid export branch (ghostty_surface_render_grid_json_v2 with history metrics, from https://github.com/manaflow-ai/cmux/pull/8860) with fork main's frame-lease rotation (https://github.com/manaflow-ai/ghostty/pull/145). Both sides independently added identical next_slot rotation to src/renderer/frame_lease.zig; the merge keeps fork main's version verbatim. No other overlaps: render_grid_json_v2 appears exactly once in include/ghostty.h and src/apprt/embedded.zig.
š¤ Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by cubic
Adds a screen-anchored render-grid export with history metrics. Keeps swap-chain slot rotation from main to fix frozen frames with fully serial presenters.
-
New Features
- New C API:
ghostty_surface_render_grid_json_v2(surface, id_ptr, id_len, state_seq, scrollback_lines, include_theme, anchor_active). anchor_active=trueanchors the grid to the active area, independent of scroll;scrollback_linesbounds history above it.- JSON now includes
history_rowsandrow_space_revisionfor precise scroll deltas and invalidation. - Existing exports keep viewport anchoring; no behavior change.
- New C API:
-
Bug Fixes
- Round-robin swap-chain slot selection so consecutive frames use distinct IOSurfaces, ensuring Core Animation recomposites and preventing frozen frames on serial producers (e.g., iOS render_now).