From f3b41b35c2fdc0e3e38bbb7bd699c6872230e459 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 24 Dec 2015 14:55:42 +0100 Subject: [PATCH] Initial creation of a ImGuiWindowFlags_NoBringToFrontOnFocus window push it at the front of global window list --- imgui.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index f2c62c6f..b0eb7f21 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3514,7 +3514,10 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFl window->AutoFitOnlyGrows = (window->AutoFitFramesX > 0) || (window->AutoFitFramesY > 0); } - g.Windows.push_back(window); + if (flags & ImGuiWindowFlags_NoBringToFrontOnFocus) + g.Windows.insert(g.Windows.begin(), window); // Quite slow but rare and only once + else + g.Windows.push_back(window); return window; }