Repository navigation
popout: a float's window keeps its title for automation - #588
Merged
Merged
Conversation
`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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
fizzy.screenand 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.windowsShownwalked 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, andDemo.frameEndread 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.idis a value), so it stays as it is.SDK impact
Verified
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 andfizzy.screenread 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'sviewportshad to bepubagain: app: every glass draws in the window material #549 dropped thepub, sobackend_native.zig's@hasDecl(@import("backend"), "viewports")is false and onmainfloats never get OS windows. That fix is not in this PR.Follow-ups
A headless reach for
Popout.windowsShownwould let a test pin float window titles; it needs a fakeviewportsto stand in for the OS windows.🤖 Generated with Claude Code