Skip to content

Ariadne windows: close and maximize buttons by default, restore glyph, manual resize ends a maximize - #1220

Merged
transfix merged 6 commits into
masterfrom
ariadne/window-chrome-buttons
Nov 15, 2026
Merged

transfix merged 6 commits into
masterfrom
ariadne/window-chrome-buttons

Conversation

@transfix

@transfix transfix commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Window chrome in Ariadne now works like a desktop window manager (Windows, macOS).

What changes

  • Buttons by default, flags to drop them. closable: now defaults to true, as maximizable: already did. A window's title bar ends with the maximize button and then the close X. closable: false and maximizable: false on a window turn either off (in a document, an include site, or Widget::closable in C++). A document with no menubar: gets the built-in Windows menu bar so a closed window can come back. That rule is unchanged; it now applies to most documents.
  • Maximize and restore (ImGui: arigl desktop and arigl-web). The button becomes the restore glyph (two squares, the front one lower-left) while maximized. The glyph now draws only the visible edges of the square behind, so a hovered button stays lit. Resting the pointer on a button shows a Close / Maximize / Restore tooltip.
  • Moving or resizing a maximized window by hand ends the maximize. A maximized window is no longer NoMove | NoResize.
    • Dragged by its title bar past ImGui's drag threshold, it comes back at its own size, under the pointer, held at the same fraction along the title bar.
    • Resized by an edge or a corner, it keeps the size it was given, and that becomes its normal size: a later maximize then restore returns to it.
    • A press on the title bar alone, or a drag that starts in the body, leaves it maximized.
  • Double click on the title bar toggles maximize, in place of ImGui's collapse for a window that has the button. On a phone view a double tap still collapses (§5.14).
  • FTXUI: a maximized window dragged by its title bar is restored under the pointer. It already drew [↑] / [↕] beside [x]. tvision keeps its own zoom box.
  • resizable: (default true). A window's own key, like closable: and maximizable: (a resizable: inside layout: stays the layout's), also settable at an include site. The core passes it before each begin_window (Backend::next_window_resizable). ImGui: NoResize, so a corner drag moves the window instead. tvision: no wfGrow, so no resize corner, and Ctrl-F5 only moves it. FTXUI draws no resize handle, so nothing changes there.
  • In front. Picking a window in the Windows menu shows it in front, as a window manager's Windows menu does: a closed one opens, and an open one stays open and is raised. Before, clicking a ticked item closed the window; now its X does that, so a closable: false window can't be closed from the menu. A window that becomes maximized (its button, a double click, or the document writing tree.<id>.maximized) also comes to the front. FtxuiBackend now implements focus_next_window. In hosted mode it reports HostedWindow::raise for that walk, and the tvision desktop selects the window.
  • A window maximized before it was ever drawn now restores to its authored size:.
  • Docs: ARIADNE.md §5.9 is now "Window chrome" and covers the buttons, resizable:, the maximize behaviour, bringing a window to the front (tree.<id>.raise, which had no docs before), and the Windows menu. §4's FTXUI and tvision notes, §5.8's resizing, and §6's include-site window keys are brought up to date.

Tests

  • cvcgl_imgui_maximize (bare ImGui context, real mouse input) adds checks for:
    • both buttons by default, and a window with both flags off having neither;
    • glyph state: vertices drawn in the button, 8 vs 15;
    • the tooltips;
    • a double click to maximize and restore, with no collapse;
    • a corner resize of a maximized window, then maximize and restore coming back to that size;
    • a title drag landing a quarter of the way along, as grabbed;
    • the X closing the window, and the document opening it again.
  • ariadne_ftxui_test: AMaximizedWindowDraggedByItsTitleIsRestored and TheWindowsMenuAndMaximizeBringAWindowToTheFront; hosted: TheHostKnowsWhichWindowsResize, TheHostRaisesAWindowOnce.
  • Loader: ResizableWindow (window key vs layout key, include site). Runtime: ANonResizableWindowTellsTheBackend. cvcgl_imgui_maximize: a resizable: false window keeps its size when its corner is dragged, and a default one grows.
  • cvcgl_imgui_windows_menu: a window opened from the menu is in front and has the keys; picking an open window raises it and leaves it open; a window the document maximizes comes in front.
  • Runtime: AWindowComesToTheFrontWhenItIsMaximized, and WindowsMenuReopensAClosedWindow now expects a pick to raise rather than close.
  • Loader and runtime tests follow the new default.
  • Tests about placement, not chrome, now say closable: false, so their windows keep the full view: cvcgl_imgui_window_fit, _ui_size, _view_shrink, and a few FTXUI graphics tests.
  • Goldens remade under llvmpipe, from a cvcpkg Mesa build on Windows. Against the old goldens, that build's frames differed only where the new buttons are, so it matches the Linux llvmpipe goldens. Every window now has its buttons, and documents with no menubar show the Windows menu bar. windows.ari's "Closable" window became "No buttons", to show the opt-out. The widgets pointer script moved 22 px down onto Reset, under the new bar.
  • macOS: widgets.macos.png and scene.macos.png are refreshed, and grid.macos.png is new, from the macOS golden job's *.actual.png artifacts (ci/full run 43581219990 on 0e43f98; all four macOS lanes drew the same frames, which match the llvmpipe goldens' layout). Apple's renderer now leaves 15 px beyond tolerance on grid (13 allowed), so grid has its own macOS golden. Master is merged in (34b3eb3, for its load_string(app, ...); the new loader test now uses fresh_load, ad77f83), and the macOS re-check is ci/full run 43636956868 on ad77f83. tvision isn't built locally: its change (wfGrow, select() on raise) is checked by Linux CI only.

Checked locally on Windows Release, with FTXUI from cvcpkg so the terminal tests ran:

  • passing: ariadne_runtime_test 267, ariadne_loader_test 229, ariadne_ftxui_test 95, cvcgl_imgui_maximize, cvcgl_imgui_windows_menu, the three placement tests and cvcgl_ari_golden 34/34;
  • ctest over the Ariadne / ari / arigl suites: 789 of 793 pass. The 4 failures are AriMedia truecolour checks that fail the same way as cvcgl_terminal_scene: this non-terminal Windows shell yields no 24-bit colour from FTXUI. They don't involve this change.
  • By hand: arigl snapshot of a test document shows both buttons by default, the opt-outs, and the restore glyph on a maximized window, in GL and with --terminal.

Clang-format: changed lines only (git-clang-format, clang-format 18.1.8).

…, manual resize ends a maximize

Window chrome now behaves like a desktop window manager:

- closable: defaults to true, like maximizable:. Every window's title bar ends with a maximize
  button and then the close X; `closable: false` / `maximizable: false` turn either off. A
  document with no menubar: gets the Windows menu bar so a closed window can come back (as it
  already did for a closable window).
- ImGui: a maximized window can be moved and resized again. Dragged by its title bar past the
  drag threshold it leaves the maximized state and comes back at its own size under the
  pointer, held where along the title bar it was grabbed. Resized by an edge or a corner, it
  leaves it at the size it was given, which becomes its own: a later maximize then restore
  comes back to it. A double click on the title bar toggles maximize (ImGui's collapse on a
  double click stays on phones). The restore glyph draws only the visible edges of the square
  behind, so a hovered button stays lit; the buttons have Close / Maximize / Restore tooltips.
- FTXUI: a maximized window dragged by its title bar is restored under the pointer.

Tests: cvcgl_imgui_maximize covers the default buttons, the opt-outs, the glyph and tooltips, a
double click, a corner resize then maximize and restore, a title drag and the close button;
ariadne_ftxui_test the title drag. Placement tests whose windows were assumed to have no close
button say closable: false. The goldens are remade under llvmpipe (every window has its buttons;
documents with no menubar: show the Windows menu bar).
…front

Picking a window in the Windows menu now shows it in front, as a window
manager's Windows menu does: a closed one opens, and an open one stays
open and is raised (its X closes it). Before, a ticked item closed the
window, and only repeat: windows were raised when reopened.

A window that becomes maximized (its button, a double click, or the
document writing tree.<id>.maximized) comes to the front the frame it is
first drawn maximized.

FtxuiBackend implements focus_next_window (the top of its stack; hosted
mode leaves stacking to the host).
A window's resizable: key (default true, like closable: and maximizable:)
says whether the user may resize it by an edge or a corner. It is the
window's own key; a resizable: inside its layout: stays the layout's. An
include site may set it too. The core passes it to the backend before
each begin_window (Backend::next_window_resizable):
- ImGui: ImGuiWindowFlags_NoResize; a corner drag moves the window.
- tvision: no wfGrow, so no resize corner and Ctrl-F5 only moves it.
- FTXUI draws no resize handle, so nothing changes there.

The tvision desktop now brings a window to the front when the core
raises it (picked in the Windows menu, or tree.<id>.raise): hosted
FtxuiBackend reports HostedWindow::raise for that walk, and the host
selects the window.

ARIADNE.md: section 5.9 is now "Window chrome" and covers resizable:,
bringing a window to the front (tree.<id>.raise, documented for the
first time), and the Windows menu. Section 4's FTXUI and tvision notes,
section 5.8's resizing, and section 6's include-site window keys are
brought up to date.
macOS CI's Apple Software Renderer (run 43581219990, all four lanes
identical) draws widgets and scene with the Windows menu bar and the
close and maximize glyphs, so widgets.macos.png and scene.macos.png
are refreshed from its actual frames. grid now leaves 15 px beyond the
tolerance there (13 allowed), so it gets grid.macos.png as well.
…ter's tests do

Master's load_string takes the app; the test came from before that.
@transfix
transfix merged commit 2b896ce into master Nov 15, 2026
57 of 58 checks passed
@transfix
transfix deleted the ariadne/window-chrome-buttons branch November 15, 2026 04:54
transfix added a commit that referenced this pull request Nov 15, 2026
- ci.yml: the sanitizer list keeps this branch's tests (stream_test, net_ws_client_test,
  ariadne_host_test) and master's planar_test.
transfix added a commit that referenced this pull request Nov 16, 2026
v4.0.0's publish-cvcpkg run (43754890264) failed all five release ari-media jobs on the player
check. #1220 made windows closable by default, so media_player.ari now gets the built-in Windows
menu bar. In a 60x14 snapshot that pushes the Player window down, and the window's own scrollbars
hide its last line, the status the check greps for (video ready/playing, audio ready/playing). The
clip and tone open; only the line is out of view.

With 20 rows the status line shows (checked with a local ari snapshot at 14 and 20 rows). The
Linux, macOS and Windows lanes change alike.
transfix added a commit that referenced this pull request Nov 16, 2026
…nubar (#1288)

ari-media 4.0.0 did not publish on linux arm64 or macOS x86_64 (publish-cvcpkg
run 43754890264). Its player smoke takes a 60x14 snapshot of
src/ari/tests/media_player.ari and greps the window's last row, the status
line. Since #1220 put a Windows menubar and a blank row above every
document's windows, that row no longer fits in 14 rows. The snapshot still
shows both players opened (0:02 and 0:01).

The Linux, macOS and Windows lanes now snapshot at 60x18. The new
AriMedia.TheLeanAriFitsThePlayerInThePublishSmoke takes the same snapshot
with the lean ari, so CI, which builds no ari-media, catches the next change
to the chrome above the window before a publish does.
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