Skip to content

Give back the static IDs the library makes for panels, layouts and itself - #331

Merged
LogicalError merged 1 commit into
mainfrom
tachyonui/release-library-static-ids
Nov 21, 2026
Merged

LogicalError merged 1 commit into
mainfrom
tachyonui/release-library-static-ids

Conversation

@LogicalError

Copy link
Copy Markdown
Owner

The library made static IDs and never gave some of them back. A panel's ID from CreatePanel stayed held after the panel closed, and so did a closed document's panels' IDs. The application's own popup, tooltip, menu, picker and toast windows, and its torn-off panel windows, also kept theirs at exit.

What changes

  • A panel gives back its own ID: when CreatePanel makes a panel's ID (the overload without one), the panel releases it when it closes. That covers:

    • its tab closing
    • its floating window closing
    • its document closing
    • a layout being applied without it

    A panel given an ID by the app leaves that ID for the app to release.

  • New calls:

    • ClosePanel(layout, panelID) closes a panel wherever it is in a layout.
    • ReleaseDockingLayout(layout) closes a whole layout for good: its torn-off windows, its panels and its tree. Call it before destroying a layout you made, or at exit.
    • CloseAllDocuments(set) closes every document of a set.
  • Cleanup: it gives back the application's own window IDs, and closes its torn-off panel windows. The window IDs are those of its menus, tooltips, pickers, toasts, task popovers and autocomplete lists.

  • State the app owns: CommandSearchState::listWindowID is made by the control but held in the app's state. Its comment now says the app releases it, as with CurveViewState::popupID.

  • Showcase:

    • At exit it closes its documents and the capture's layout, and releases the command search's results window.
    • A temporary trace showed it ends holding no static ID.
  • Docs: the IDs overview lists what the library gives back by itself and what stays the app's. The docking guide covers ClosePanel and ReleaseDockingLayout, and the changelog has an entry.

Tests

  • New: a closed panel's ID goes back, unless the app gave it.
  • New: releasing a layout gives back its panels' and its tree's IDs, and hides a shown panel first.
  • New: closing all documents gives back their IDs.
  • New: Cleanup leaves no static ID held. The test covers toasts, menu windows, pickers and a torn-off window.
  • Changed counts: the floating-window and documents tests now count the panel's ID too. The preset test checks that a panel closed by a preset gives its ID back. The test of a floating window emptied by a drag now moves its panel to another layout, as a real drag does, and checks that the panel keeps its ID there.

Validation

  • Full Debug build: no errors or warnings.
  • gui_core_tests, gui_vulkan_tests, gui_gpu_tests, gui_d3d12_tests and gui_sdlgpu_tests all pass on Windows.
  • A showcase --bench run reports no errors.

…self

The library made static IDs it never released: a panel's from
CreatePanel, when the panel closed; a closed document's panels'; and the
application's own popup, tooltip, menu, picker and toast windows and its
torn-off panel windows at exit.

- A panel CreatePanel made an ID for keeps that it owns it, and gives it
  back when it closes: its tab, its floating window, its document, or a
  layout applied without it. One the app gave stays the app's.
- ClosePanel closes a panel wherever it is in a layout.
- ReleaseDockingLayout closes a whole layout for good: its torn-off
  windows, its panels and its tree.
- CloseAllDocuments closes a document set.
- Cleanup gives back the application's own window IDs (menus, tooltips,
  pickers, toasts, task popovers, autocomplete lists) and closes its
  torn-off panel windows.
- Showcase: closes its documents and the capture's layout at exit, and
  releases the command search's results window; it ends holding no
  static ID.
- Docs: what the library gives back by itself, and what stays the app's.
- Tests: a closed panel's ID goes back unless it was the app's;
  releasing a layout gives back its panels' and tree's; closing all
  documents gives back theirs; Cleanup leaves no static ID held. The
  docking, documents and preset tests count the panel's ID as well.
@LogicalError
LogicalError merged commit 19151b1 into main Nov 21, 2026
7 of 8 checks passed
@LogicalError
LogicalError deleted the tachyonui/release-library-static-ids branch November 21, 2026 19:46
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