Skip to content

Commit dbd9ae2

Browse files
committed
Windows: fixed SetNextWindowCollapsed()/SetWindowCollapsed() breaking codepath that preserve last contents size when collapsed. (#7691)
1 parent 702a678 commit dbd9ae2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

docs/CHANGELOG.txt

+4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ Other changes:
4848

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

imgui.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -8228,8 +8228,10 @@ void ImGui::SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiCond co
82288228
return;
82298229
window->SetWindowCollapsedAllowFlags &= ~(ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing);
82308230

8231-
// Set
8232-
window->Collapsed = collapsed;
8231+
// Queue applying in Begin()
8232+
if (window->WantCollapseToggle)
8233+
window->Collapsed ^= 1;
8234+
window->WantCollapseToggle = (window->Collapsed != collapsed);
82338235
}
82348236

82358237
void ImGui::SetWindowHitTestHole(ImGuiWindow* window, const ImVec2& pos, const ImVec2& size)

0 commit comments

Comments
 (0)