From 921842e8a17ddb29190b2062a2b65d9cf858f1d1 Mon Sep 17 00:00:00 2001 From: ocornut Date: Fri, 30 Jan 2026 18:44:01 +0100 Subject: [PATCH] Docking: make dock node tab bar ID match parent ID of its tab items. --- imgui.cpp | 2 +- imgui_widgets.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index f3ad0856a..eebffff22 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -19406,7 +19406,7 @@ static void ImGui::DockNodeUpdateTabBar(ImGuiDockNode* node, ImGuiWindow* host_w tab_bar_flags |= ImGuiTabBarFlags_DrawSelectedOverline; if (!host_window->Collapsed && is_focused) tab_bar_flags |= ImGuiTabBarFlags_IsFocused; - tab_bar->ID = GetID("#TabBar"); + tab_bar->ID = node->ID;// GetID("#TabBar"); tab_bar->SeparatorMinX = node->Pos.x + host_window->WindowBorderSize; // Separator cover the whole node width tab_bar->SeparatorMaxX = node->Pos.x + node->Size.x - host_window->WindowBorderSize; BeginTabBarEx(tab_bar, tab_bar_rect, tab_bar_flags); diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 93589a1c4..57ab6f0ed 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -9659,7 +9659,7 @@ bool ImGui::BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& tab_bar_bb, ImG return false; IM_ASSERT(tab_bar->ID != 0); - if ((flags & ImGuiTabBarFlags_DockNode) == 0) + if ((flags & ImGuiTabBarFlags_DockNode) == 0) // Already done PushOverrideID(tab_bar->ID); // Add to stack @@ -9742,7 +9742,7 @@ void ImGui::EndTabBar() window->DC.CursorPos = tab_bar->BackupCursorPos; tab_bar->LastTabItemIdx = -1; - if ((tab_bar->Flags & ImGuiTabBarFlags_DockNode) == 0) + if ((tab_bar->Flags & ImGuiTabBarFlags_DockNode) == 0) // Already done PopID(); g.CurrentTabBarStack.pop_back();