Repository navigation
Fix text field capacity aborts, TabPanel hidden-strip tab loss, StickyHeaderList click-through and DividerContainer gaps - #729
Merged
Conversation
A tab picked while ShowTabStrip is off is now asked of the strip's first visible frame, so showing the strip again no longer reverts to the tab Dear ImGui last had selected. RemoveTab keeps the same tab active when an earlier one goes and moves to the active tab's neighbour when it goes itself, telling a visible strip too. Every change of active tab is reported once through one helper, keyed by tab id, whether it came from a click, ActiveTabIndex or RemoveTab, so a hidden strip reports picks and a tab that only moved index reports nothing. Fixes #711 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RbrgmjhBm6arqvhHro2wgJ
…eneath it The pinned header is painted over the rows once they are all submitted, but Dear ImGui gives the pointer to the first item submitted under it, so the hidden row was hovered and clicked through the header. The list now remembers where its header was pinned last frame and submits an invisible button there before any row. Fixes #712 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RbrgmjhBm6arqvhHro2wgJ
…t or layout Zones now share what is left once n gaps are taken out: a whole gap between two zones and half of one at each end, every edge rounded once from its exact position, and each divider in the middle of its gap. The arithmetic lives in the ImGui-free DividerContainerLayout, which also gives a drag the fraction that puts the divider under the pointer. The gap follows the window padding along the container's axis, and the container no longer scrolls or shows a scrollbar for the cursor its positioned zones leave behind. A single zone still fills the container. Fixes #724 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RbrgmjhBm6arqvhHro2wgJ
…ixed capacity Hexa's InputText(label, ref string, maxLength) tells Dear ImGui the buffer is maxLength bytes whatever the string's length, so activating a field holding more failed a native assertion and aborted the process. ResizableInputText hands ImGui a native buffer sized from the value and grows it through CallbackResize, and every string field in the suite now goes through it: the data table's text editor, the property grid's text, path and list rows, SearchBox, ValueSlider's editor, TimecodeField, PinInput, the node editor's string pin editor and comment rename box, and the popups' InputString, SearchableList and filesystem browser (path box, search and file name). ImGui.Popups links the file, since it does not reference ImGui.Widgets. The file name box used to be capped below the length a file name may have, so a name too long for the system now reaches the browser; it is refused with a message instead of throwing out of the frame. Fixes #553 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RbrgmjhBm6arqvhHro2wgJ
SonarCloud's security rating fails new pointer code even under an S6640 suppression, and the CallbackResize buffer in ResizableInputText was that: NativeMemory, a pointer as user data, and AllowUnsafeBlocks in ImGui.Popups. The helper now calls Hexa's managed InputText(label, ref string, maxLength) overloads with a capacity worked out every frame from the value's UTF-8 length: the value, its terminator, and headroom of 1024 bytes or the value's own length, whichever is larger. Hexa allocates the larger of the string and maxLength, plus the terminator, so the value always fits and activating a field can no longer fail ImGui's assertion. ImGui.Popups no longer allows unsafe code. Trade-off: Dear ImGui fixes a field's capacity when it is activated and does not take a larger one while the field stays active (measured: a second 1000-character paste into an active field that started empty stopped at 1025 characters). So one edit can add at most the headroom, and text past it is cut rather than aborting the process. The next edit starts from the longer value with headroom again. The 5000-character paste test now asserts the cut to the headroom, a new test shows each new edit getting room to grow, and the long-path browser test uses a path that fits one edit. Refs #553 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RbrgmjhBm6arqvhHro2wgJ
|
This was referenced Oct 26, 2026
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.



Requested by Certified Turtle · project thread
Four bug fixes, one commit each. A fifth commit reworks the #553 helper so it has no pointer code, for SonarCloud's security rating.
Text fields no longer abort the process on long values
Fixes #553
Cause: Hexa's
InputText(label, ref string, maxLength)allocates room for the larger of the string andmaxLength, plus the terminator. It then tells ImGui the buffer is onlymaxLengthbytes. When a field was activated with a value at or past a fixedmaxLength, ImGui's assertion failed and the process aborted.Fix: a new internal helper,
ResizableInputText(ImGui.Widgets/ResizableInputText.cs), in managed code only, with nounsafeor pointers. It calls Hexa's managed overloads with a capacity worked out every frame from the value's UTF-8 length:The value always fits, so no value is too long to activate.
Trade-off: Dear ImGui fixes a field's capacity when the field is activated, and doesn't take a larger one while it stays active. I measured this: a second 1000-character paste into a field that started empty stopped at 1025 characters. So one edit can add at most the headroom. Text beyond that is cut, not an abort, and the next edit gets headroom again. Lifting this limit would need a
CallbackResizenative buffer, which is pointer code. The first version of this PR used one, and SonarCloud's security rating failed it.Where it's used: every fixed-capacity string field in the libraries now goes through the helper. No
InputText/InputTextWithHintcall with a fixed length is left.DataTableEditors. Its existing caret callback is kept.PropertyGridtext, path and list rowsSearchBoxValueSlider's editorTimecodeFieldPinInputInputStringSearchableListFilesystemBrowser's path box, search box and file name boxImGui.Popupsdoesn't referenceImGui.Widgets, so it links the helper's source file. It needs noAllowUnsafeBlocks.Follow-on fix: the old 256-byte name box stopped anyone typing a file name too long for the system. Such a name now reaches the browser, and the browser used to throw out of the frame when building the path.
TryGetFullPathnow refuses it with an "Invalid File Name" message.Tests:
TabPanel keeps its tab when ShowTabStrip is off
Fixes #711
RemoveTabkeeps the same tab active when an earlier tab is removed. When the active tab itself is removed, it moves to its neighbour. Either way it tells a visible strip too.ActiveTabIndexandRemoveTab. A hidden strip now reports picks, and a tab that only moved index reports nothing.ActiveTabIndexwhile the strip is shown now raisesTabChangedonce, when the tab is drawn. It previously raised nothing.TabPanelTests: the issue's three scenarios, a pick under a hidden strip, removing the active tab, and removing an earlier tab with the strip shown.StickyHeaderList's pinned header blocks clicks to the rows under it
Fixes #712
InvisibleButtonthere for the left, right and middle mouse buttons, then restores the cursor.Dispose.DividerContainer gaps are uniform
Fixes #724
DividerContainerLayoutuses the uniform-gap model from the issue:nzones costn × gap.DividerContainerLayoutTests.DividerContainerTests, each run in both Columns and Rows: 3 zones, 2 even zones and 5 zones, checking equal gaps, equal outer margins and centred dividers. These fail on the old code.CLAUDE.md has new Key Files entries for both new files.
Tests run
Built with
dotnet build -c Release: 0 errors. Results are from each suite's built test executable, in Release, run after the managed rework:--check)🤖 Generated with Claude Code
https://claude.ai/code/session_01RbrgmjhBm6arqvhHro2wgJ