diff --git a/imgui.cpp b/imgui.cpp index 58d30b01..f318c7c2 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6842,7 +6842,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // There's little point to expose a flag to set this: because the interesting cases won't be using parent_window_in_stack, // e.g. linking a tool window in a standalone viewport to a document window, regardless of their Begin() stack parenting. (#6798) - window->ParentWindowForFocusRoute = (flags & ImGuiWindowFlags_ChildWindow) ? parent_window_in_stack : NULL; + window->ParentWindowForFocusRoute = (window->RootWindow != window) ? parent_window_in_stack : NULL; } // Add to focus scope stack