Skip to content

Commit 0eb45a0

Browse files
committed
Docking: fix 58f5092 (ocornut#4310)
If we clear _ChildWindow flag we must remove it from here otherwise render loop will fail.
1 parent 58f5092 commit 0eb45a0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

imgui.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -13112,8 +13112,11 @@ void ImGui::DockContextProcessUndockNode(ImGuiContext* ctx, ImGuiDockNode* node)
1311213112
DockSettingsRenameNodeReferences(node->ID, new_node->ID);
1311313113
for (int n = 0; n < new_node->Windows.Size; n++)
1311413114
{
13115-
new_node->Windows[n]->Flags &= ~ImGuiWindowFlags_ChildWindow;
13116-
UpdateWindowParentAndRootLinks(new_node->Windows[n], new_node->Windows[n]->Flags, NULL);
13115+
ImGuiWindow* window = new_node->Windows[n];
13116+
window->Flags &= ~ImGuiWindowFlags_ChildWindow;
13117+
if (window->ParentWindow)
13118+
window->ParentWindow->DC.ChildWindows.find_erase(window);
13119+
UpdateWindowParentAndRootLinks(window, window->Flags, NULL);
1311713120
}
1311813121
node = new_node;
1311913122
}
@@ -13297,6 +13300,8 @@ static void ImGui::DockNodeRemoveWindow(ImGuiDockNode* node, ImGuiWindow* window
1329713300
window->DockIsActive = window->DockTabWantClose = false;
1329813301
window->DockId = save_dock_id;
1329913302
window->Flags &= ~ImGuiWindowFlags_ChildWindow;
13303+
if (window->ParentWindow)
13304+
window->ParentWindow->DC.ChildWindows.find_erase(window);
1330013305
UpdateWindowParentAndRootLinks(window, window->Flags, NULL); // Update immediately
1330113306

1330213307
// Remove window

0 commit comments

Comments
 (0)