Windows: fixed SetNextWindowCollapsed()/SetWindowCollapsed() breaking codepath that preserve last contents size when collapsed. (#7691)

This commit is contained in:
ocornut 2025-03-23 12:55:59 +01:00
parent 702a67807b
commit dbd9ae287a
2 changed files with 8 additions and 2 deletions

View file

@ -48,6 +48,10 @@ Other changes:
- IO: variations in analog-only components of gamepad events do not interfere
with trickling of mouse position events (#4921, #8508)
- Windows: fixed SetNextWindowCollapsed()/SetWindowCollapsed() breaking
codepath that preserve last contents size when collapsed, resulting in
programmatically uncollapsing auto-sizing windows having them flicker size
for a frame. (#7691) [@achabense]
- Error Handling: added better error report and recovery for extraneous
EndPopup() call. (#1651, #8499)
- Style, InputText: added ImGuiCol_InputTextCursor to configure color of

View file

@ -8228,8 +8228,10 @@ void ImGui::SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiCond co
return;
window->SetWindowCollapsedAllowFlags &= ~(ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing);
// Set
window->Collapsed = collapsed;
// Queue applying in Begin()
if (window->WantCollapseToggle)
window->Collapsed ^= 1;
window->WantCollapseToggle = (window->Collapsed != collapsed);
}
void ImGui::SetWindowHitTestHole(ImGuiWindow* window, const ImVec2& pos, const ImVec2& size)