From ae657a349ae48088552e71ceb5a06116c32cbbd9 Mon Sep 17 00:00:00 2001 From: omar Date: Sun, 30 Sep 2018 23:06:46 +0200 Subject: [PATCH] Docking: Fixed extracting a dock node from a document root: document root should be preserved. --- imgui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 623fac46..28fa9e99 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -10150,9 +10150,9 @@ void ImGui::DockContextProcessUndockNode(ImGuiContext* ctx, ImGuiDockNode* node) IM_ASSERT(!node->IsSplitNode()); IM_ASSERT(node->Windows.Size >= 1); - // In the case of a root node, a node will have to stay in place. Create a new node for this purpose. + // In the case of a root node or document root, the node will have to stay in place. Create a new node to receive the payload. // Otherwise delete the previous node by merging the other sibling back into the parent node. - if (node->IsRootNode()) + if (node->IsRootNode() || node->IsDocumentRoot) { // FIXME-DOCK: Transition persistent DockId for all non-active windows ImGuiDockNode* new_node = DockContextAddNode(ctx, 0);