Skip to content

Docking a Window manually causes an assert indised of DockNodeFindInfo #8145

Open
@Link459

Description

@Link459

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:

[Window][Debug##Default]
Pos=60,60
Size=400,400
Collapsed=0

[Window][Hello, world!]
Pos=283,408
Size=339,180
Collapsed=0

[Window][Dear ImGui Demo]
Pos=899,214
Size=550,680
Collapsed=0

[Window][WindowOverViewport_11111111]
Pos=0,0
Size=1916,1076
Collapsed=0

[Window][Viewport]
Pos=0,0
Size=1916,1076
Collapsed=0
DockId=0x03954D96,0

[Window][Another Window]
Pos=60,60
Size=198,71
Collapsed=0

[Docking][Data]
DockSpace ID=0x03954D96 Window=0xA87D555D Pos=0,0 Size=1916,1076 CentralNode=1 Selected=0x13926F0B

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:

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.

Screenshots/Video:

imgui_docking.mp4

Minimal, Complete and Verifiable Example code:

ImGuiID id = ImGui::GetID("dock_space");
ImGuiViewport* viewport = ImGui::GetMainViewport();
ImGuiID dockspace = ImGui::DockSpaceOverViewport(id, viewport,ImGuiDockNodeFlags_PassthruCentralNode | ImGuiDockNodeFlags_CentralNode);
if (ImGui::Begin("Viewport", nullptr,
    ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoTitleBar))
{
    ImGui::End(); 
}
ImGuiID dockspace_id = ImGui::GetID("dock_space");
ImGui::DockBuilderDockWindow("Viewport", dockspace_id);
ImGui::DockBuilderFinish(dockspace_id);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions