Skip to content

Combo: fix assertion failure when ConfigDebugBeginReturnValueOnce=true - #8931

Closed
harrymander wants to merge 1 commit into
ocornut:masterfrom
harrymander:fix-begin-combo-popup-assertion-fail
Closed

harrymander wants to merge 1 commit into
ocornut:masterfrom
harrymander:fix-begin-combo-popup-assertion-fail

Conversation

@harrymander

Copy link
Copy Markdown
Contributor

This fixes an assertion failure when calling BeginCombo with IO config ConfigDebugBeginReturnValueOnce=true, which causes all calls to Begin to return false on first use.

@harrymander
harrymander changed the base branch from master to docking September 10, 2025 04:46
@harrymander
harrymander changed the base branch from docking to master September 10, 2025 04:47
harrymander added a commit to harrymander/swallow-labeller that referenced this pull request Sep 10, 2025
ocornut pushed a commit that referenced this pull request Sep 10, 2025
…sing io.ConfigDebugBeginReturnValueOnce/ConfigDebugBeginReturnValueLoop. (#8931)
@ocornut

ocornut commented Sep 10, 2025

Copy link
Copy Markdown
Owner

Thank you Harry for your PR. Nice catch, and glad that someone has tried using this tool :)
Merged as 5e5658e.
I took the liberty to slightly rewrite the check from:

// Begin will only return false when ConfigDebugBeginReturnValueOnce is true and opening for the first time
IM_ASSERT(g.IO.ConfigDebugBeginReturnValueOnce);

To

if (!g.IO.ConfigDebugBeginReturnValueOnce && !g.IO.ConfigDebugBeginReturnValueLoop) // Begin may only return false with those debug tools activated.
   IM_ASSERT(0); // This should never happen as we tested for IsPopupOpen() above

Which I believe conveys the intent better. I also included ConfigDebugBeginReturnValueLoop even though in practice I couldn't get it to trigger which this I'm pretty sure in practice it would as well.

@ocornut ocornut closed this Sep 10, 2025
harrymander added a commit to harrymander/imgui that referenced this pull request Sep 10, 2025
…sing io.ConfigDebugBeginReturnValueOnce/ConfigDebugBeginReturnValueLoop. (ocornut#8931)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

⌂ 换网址