Skip to content

popout: a float's window keeps its title for automation - #588

Merged
foxnne merged 1 commit into
mainfrom
popout/float-window-title
Oct 18, 2026
Merged

foxnne merged 1 commit into
mainfrom
popout/float-window-title

Conversation

@foxnne

@foxnne foxnne commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

fizzy.screen and tapes see a float's OS window by its real title again, so an agent or a demo can aim at it by name. Before, a float window was listed as e.g. .name="\x01\x00\x00\x00\x04…", .tag="fizzy.window:float:\x00\x00…" (seen 2026-10-18 on macOS, FIZZY_WORKSPACES=1, a floated document).

The cause: Popout.windowsShown walked the float slots by value (for (outs) |slot| { const o = slot orelse continue; … }), so .title = o.title_buf[0..o.title_len] was a slice into a stack copy that died with each iteration, and Demo.frameEnd read it after. The loop now walks the slots by pointer, so the title is a slice of the float's own buffer, which lives as long as the float does.

The menus/dialogs loop below it copies the same way but takes nothing by reference from its copy (a dialog's title comes from core.dialogs.dialogTitle, m.id is a value), so it stays as it is.

SDK impact

  • None

Verified

  • macOS: scripts/check-fmt.sh, zig build, zig build test, zig build test-integration (78/78 steps), zig build check-web, zig build test-sdk-version. Live, in a fizzy of its own (--profile, FIZZY_WORKSPACES=1), with the Output view floated by a live tape and fizzy.screen read over the control socket. Without this change: .name="\x01\x00\x00\x00\x04\x00", .tag="fizzy.window:float:\x00\x00\x00\x00XI", and the JSON route refuses the whole screen (the command's result holds text that is not UTF-8). With it: .name="Output", .tag="fizzy.window:float:Output".
    For that check SDLBackend.zig's viewports had to be pub again: app: every glass draws in the window material #549 dropped the pub, so backend_native.zig's @hasDecl(@import("backend"), "viewports") is false and on main floats never get OS windows. That fix is not in this PR.
  • Windows:
  • Linux:
  • Web: n/a (no popouts on web)

Follow-ups

A headless reach for Popout.windowsShown would let a test pin float window titles; it needs a fake viewports to stand in for the OS windows.

🤖 Generated with Claude Code

`Popout.windowsShown` walked the float slots by value, so each float's
`title` was a slice of `title_buf` in a stack copy that died with the
iteration. `Demo.frameEnd` then named float windows from garbage, and
`fizzy.screen` listed them as `.name="\x01\x00…"`, `.tag="fizzy.window:float:\x00…"`:
tapes and agents could not aim at a float's window by its title.

The loop now walks the slots by pointer, so the title is a slice of the
float's own buffer, which lives until the float closes. The menus and
dialogs loop below it copies too, but takes nothing by reference from the
copy (a dialog's title comes from `core.dialogs`), so it stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@foxnne
foxnne merged commit 077d065 into main Oct 18, 2026
11 checks passed
@foxnne
foxnne deleted the popout/float-window-title branch October 18, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant