You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docking window results in an assert inside DockNodeFindInfo
I was trying to programmatically attach a window to a dock space on the central node.
It was attaching the window correctly as far as I can tell but once I tried to manually attach another window to the dockspace I got this assert:
void DockNodeFindInfo(ImGuiDockNode*, ImGuiDockNodeTreeInfo*): Assertion `node->IsLeafNode() && "If you get this assert: please submit .ini file + repro of actions leading to this."' failed.
This happened whenever I tried to attach a window to the left, right, bottom or top of the dockspace.
(
For the record, your code is a bit confusing because you are holding the same value in three spots:
ImGuiID id = ImGui::GetID("dock_space");
[...]
ImGuiID dockspace = ImGui::DockSpaceOverViewport(id, ....); // this return the value you passed to it (if you pass 0 it generates an id)
[...]
ImGuiID dockspace_id = ImGui::GetID("dock_space");
Therefore in your code id and dockspace and dockspace_id are all the same value!
)
I was a little confused by this, and then realized the (non-obvious) issue:
Passing ImGuiDockNodeFlags_CentralNode to DockSpace() or DockSpaceOverViewport() is not only unnecessary (because DockSpace currently adds it) but it creates a huge bug as the flag is stored in node->SharedFlags and then not moved to inheriting child when split, creating a largely inconsistent state.
If you remove the ImGuiDockNodeFlags_CentralNode value it should work.
Note that in your repro you are calling DockBuilderDockWindow() every frame which is likely not desirable. You may want to check earlier if the node existed, or if you are in a special reset state, in order to call.
I am going to research if I can better document/fix this, possibly by making it clearly illegal to pass this flag to DockSpace(), but it's part of a larger required rework as the concept of CentralNode is quite confusing/broken right now.
Version/Branch of Dear ImGui:
Version: 1.91.5
Branch: docking
Back-ends:
imgui_impl_vulkan.cpp + imgui_impl_sdl3.cpp
Compiler, OS:
linux + gcc 14.2.1
Full config/build information:
Details:
Docking window results in an assert inside DockNodeFindInfo
I was trying to programmatically attach a window to a dock space on the central node.
It was attaching the window correctly as far as I can tell but once I tried to manually attach another window to the dockspace I got this assert:
This happened whenever I tried to attach a window to the left, right, bottom or top of the dockspace.
Screenshots/Video:
imgui_docking.mp4
Minimal, Complete and Verifiable Example code:
The text was updated successfully, but these errors were encountered: