diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 0e319f796..99b364ebd 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -59,6 +59,8 @@ Docking+Viewports Branch: - Nav: fixed a crash that could occur when opening a popup following the processing of a global shortcut while no windows were focused (the fix done in 1.92.3 was incomplete for docking branch). +- Viewports: fixed a bug where ImGuiWindowFlags_NoBringToFrontOnFocus would effectivey + be ignored when windows first appear and viewports are enabled. (#7008) [@jshofmann] - Viewports: changed default value of io.ConfigViewportsNoDefaultParent to true. (#8948) - Viewports: fixed an issue inferring Z-order when attempting to merge a viewport back in the the main/hosting viewport. (#8948) diff --git a/imgui.cpp b/imgui.cpp index 524142633..a011a07af 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -16365,7 +16365,8 @@ static bool ImGui::UpdateTryMergeWindowIntoHostViewport(ImGuiWindow* window, ImG if (g.Windows[n]->Viewport == old_viewport) SetWindowViewport(g.Windows[n], viewport); SetWindowViewport(window, viewport); - BringWindowToDisplayFront(window); + if ((window->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus) == 0) + BringWindowToDisplayFront(window); return true; }