Repository navigation
Give back the static IDs the library makes for panels, layouts and itself - #331
Merged
Merged
Conversation
…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.
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.
The library made static IDs and never gave some of them back. A panel's ID from
CreatePanelstayed 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
CreatePanelmakes a panel's ID (the overload without one), the panel releases it when it closes. That covers: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::listWindowIDis made by the control but held in the app's state. Its comment now says the app releases it, as withCurveViewState::popupID.Showcase:
Docs: the IDs overview lists what the library gives back by itself and what stays the app's. The docking guide covers
ClosePanelandReleaseDockingLayout, and the changelog has an entry.Tests
Cleanupleaves no static ID held. The test covers toasts, menu windows, pickers and a torn-off window.Validation
gui_core_tests,gui_vulkan_tests,gui_gpu_tests,gui_d3d12_testsandgui_sdlgpu_testsall pass on Windows.--benchrun reports no errors.