Skip to content

Ariadne windows: a long title stops short of the maximize button - #1269

Merged
transfix merged 1 commit into
masterfrom
ariadne/title-clip-max-button
Nov 16, 2026
Merged

transfix merged 1 commit into
masterfrom
ariadne/title-clip-max-button

Conversation

@transfix

Copy link
Copy Markdown
Owner

A window title longer than its window used to run under the maximize button. Now it stops short of that button, the same way ImGui already stops it short of the close button. This was the follow-up left open by #1220.

Why it happened: ImGui lays out a window's title inside Begin, and leaves room only for the close button and the collapse arrow. The maximize button is drawn after Begin, so the title ran underneath it.

Change (src/cvcGL/ariadne/ImGuiBackend.cpp, ImGui backend only):

  • A window that shows the maximize button is begun as ###<id>. ImGui takes a window's id from the part after ###, so this is the same ImGui window, but ImGui draws no title text for it.
  • title_text then draws the title where ImGui 1.92's RenderWindowTitleBarContents would, with the same alignment and clip rules, and one more button's width of room on the right.
  • A title that already fits lands on the same pixels. The goldens are unchanged: 0 px differ in all five documents.
  • After Begin, the window's name is copied back to title###id. ImGui's Ctrl+Tab list reads that name, and would otherwise show "(Untitled)".
  • Windows without the maximize button (maximizable: false) are drawn exactly as before.

Test (cvcgl_imgui_maximize, real ImGui): a 160 px wide window with a long title.

  • Only the button's square is drawn inside the maximize button: 8 vertices, the same as a window with a short title.
  • The title is still drawn to the left of the button.
  • The ImGui window keeps its full name.
  • With the fix turned off, this test fails (14 vertices inside the button against 8).

Verified locally (Windows Release, llvmpipe):

  • cvcgl_imgui_maximize, cvcgl_imgui_windows_menu and cvcgl_imgui_window_fit pass, and golden 34/34 with 0 px different.
  • ctest's ImGui/Ariadne subset: 882 of 886 pass. The 4 failures are AriMedia colour checks that fail only in this non-terminal shell; they are unrelated to this change.
  • The changed lines are clang-format clean.
  • macOS CI hasn't run on this, but since the goldens draw the same pixels on Windows, I don't expect the macOS goldens to change.

ImGui lays out a window's title in Begin, leaving room for the close
button and the collapse arrow only, so a title longer than its window
ran under the maximize button drawn after it. A window with that button
is now begun as "###<id>" (the same ImGui window) and its title is
drawn after Begin where ImGui 1.92's RenderWindowTitleBarContents would
put it, with one more button's room on the right. Titles that fit land
on the same pixels (the goldens are unchanged, 0 px differ). The
window's name is put back to "title###id" for ImGui's Ctrl+Tab list.

cvcgl_imgui_maximize: a 160 px window with a long title draws only the
button's square inside the button, its title left of it, and keeps its
name.
@transfix
transfix enabled auto-merge (squash) November 15, 2026 06:39
@transfix
transfix merged commit fd60235 into master Nov 16, 2026
28 checks passed
@transfix
transfix deleted the ariadne/title-clip-max-button branch November 16, 2026 02:45
transfix added a commit that referenced this pull request Nov 16, 2026
- script_engine.cpp: #1283 factors the sliced form's process lookup into calling_process,
  which run_as_program_work (a client's WebAssembly guest, run as its client's program) shares.
  The lookup keeps this branch's group: the calling process is on the group whose pump runs the
  call (an isolated document's), else on group 0.
- STATE_EXEC_THREADED.md: notes that run_as_program_work shares the lookup.
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