Fixed window using the ImGuiWindowFlags_AlwaysAutoResize flag would have ItemWidth default change when docked. (#9355, #9443)

Amend 95bd1577d,
This commit is contained in:
ocornut
2026-06-16 15:04:22 +02:00
parent 2af6dd9694
commit 1ba29f2bec
2 changed files with 5 additions and 1 deletions

View File

@@ -88,6 +88,10 @@ Docking+Viewports Branch:
- Viewports:
- Fixed an issue where the implicit "Debug" window while hidden would erroneously
interfere with merging secondary viewports into the main viewport.
- Docking:
- Fixed behavior change/regression in 1.92.8 where a window using the
ImGuiWindowFlags_AlwaysAutoResize flag would have ItemWidth default
change when docked. (#9355, #9443) [@reybits]
-----------------------------------------------------------------------

View File

@@ -8591,7 +8591,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// Default item width. Make it proportional to window size if window can be manually resized.
// (we cannot use AutoFitFramesX/AutoFitFramesY which is a temporary state)
bool is_resizable_width;
if (flags & ImGuiWindowFlags_ChildWindow)
if ((flags & ImGuiWindowFlags_ChildWindow) && !window->DockIsActive)
is_resizable_width = (window->Size.x > 0.0f) && !(window->ChildFlags & (ImGuiChildFlags_AutoResizeX | ImGuiChildFlags_AlwaysAutoResize));
else
is_resizable_width = (window->Size.x > 0.0f) && !(flags & ImGuiWindowFlags_AlwaysAutoResize);