mirror of
https://github.com/ocornut/imgui.git
synced 2025-09-20 02:08:25 +00:00
Docking+Viewports: Fix undocking window node causing parent viewport to become unresponsive. (#5503)
Amend67be485e
, Somehow ties to58f5092c
+0eb45a05
(#4310) Unsure of exact chain of event but this caused a parent link msimatch between the time of the MouseMoving test in AddUpdateViewport() setting _NoInputs on the wrong parent., and the release clearing _NoInputs on the rght one.
This commit is contained in:
16
imgui.cpp
16
imgui.cpp
@@ -14460,14 +14460,6 @@ void ImGui::DockContextProcessUndockNode(ImGuiContext* ctx, ImGuiDockNode* node)
|
||||
new_node->SizeRef = node->SizeRef;
|
||||
DockNodeMoveWindows(new_node, node);
|
||||
DockSettingsRenameNodeReferences(node->ID, new_node->ID);
|
||||
for (int n = 0; n < new_node->Windows.Size; n++)
|
||||
{
|
||||
ImGuiWindow* window = new_node->Windows[n];
|
||||
window->Flags &= ~ImGuiWindowFlags_ChildWindow;
|
||||
if (window->ParentWindow)
|
||||
window->ParentWindow->DC.ChildWindows.find_erase(window);
|
||||
UpdateWindowParentAndRootLinks(window, window->Flags, NULL);
|
||||
}
|
||||
node = new_node;
|
||||
}
|
||||
else
|
||||
@@ -14480,6 +14472,14 @@ void ImGui::DockContextProcessUndockNode(ImGuiContext* ctx, ImGuiDockNode* node)
|
||||
node->ParentNode->AuthorityForViewport = ImGuiDataAuthority_Window; // The node that stays in place keeps the viewport, so our newly dragged out node will create a new viewport
|
||||
node->ParentNode = NULL;
|
||||
}
|
||||
for (int n = 0; n < node->Windows.Size; n++)
|
||||
{
|
||||
ImGuiWindow* window = node->Windows[n];
|
||||
window->Flags &= ~ImGuiWindowFlags_ChildWindow;
|
||||
if (window->ParentWindow)
|
||||
window->ParentWindow->DC.ChildWindows.find_erase(window);
|
||||
UpdateWindowParentAndRootLinks(window, window->Flags, NULL);
|
||||
}
|
||||
node->AuthorityForPos = node->AuthorityForSize = ImGuiDataAuthority_DockNode;
|
||||
node->Size = FixLargeWindowsWhenUndocking(node->Size, node->Windows[0]->Viewport);
|
||||
node->WantMouseMove = true;
|
||||
|
Reference in New Issue
Block a user