From c1ab3c406f3497f77c1a455557c331f0a2fa4bb5 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 2 Feb 2022 23:10:14 +0100 Subject: [PATCH] Docking: Fixed size constraints not working on single window holding on a dock id (still doesn't work on docked windows). --- docs/CHANGELOG.txt | 3 ++- imgui.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 5cf9a9afc550..3f324ea2f97f 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -231,6 +231,8 @@ Other Changes: Docking+Viewports Branch: +- Docking: Fixed a CTRL+TAB crash when aiming at an empty docked window. (#4792) +- Docking: Fixed size constraints not working on single window holding on a dock id (still doesn't work on docked windows). - Viewports, IO: Added io.AddMouseViewportEvent() function to queue hovered viewport change (when known by backend). - Viewports: Relaxed specs for backend supporting ImGuiBackendFlags_HasMouseHoveredViewport: it is now _optional_ for the backend to have to ignore viewports with the _NoInputs flag when call io.AddMouseViewportEvent(). It is @@ -240,7 +242,6 @@ Docking+Viewports Branch: io.AddMouseViewportEvent() function, then Dear ImGui will revert to its flawed heuristic to find the viewport under. By lowering those specs, we allow the SDL and more backend to support this, only relying on the heuristic in a few drag and drop situations rather that relying on it everywhere. -- Docking: Fixed a CTRL+TAB crash when aiming at an empty docked window. (#4792) - Viewports: Fixed a CTRL+TAB crash with viewports enabled when the window list needs to appears in its own viewport (regression from 1.86). (#4023, #787) - Viewports: Fixed active InputText() from preventing viewports to merge. (#4212) diff --git a/imgui.cpp b/imgui.cpp index dbea7ad93199..29ac68f4b0bd 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6383,7 +6383,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) IM_ASSERT(window->DockNode != NULL); // Docking currently override constraints - g.NextWindowData.Flags &= ~ImGuiNextWindowDataFlags_HasSizeConstraint; + if (window->DockIsActive) + g.NextWindowData.Flags &= ~ImGuiNextWindowDataFlags_HasSizeConstraint; // Amend the Appearing flag if (window->DockTabIsVisible && !dock_tab_was_visible && dock_node_was_visible && !window->Appearing && !window_was_appearing)