Viewports: fix ImGuiWindowFlags_NoBringToFrontOnFocus being ignored when windows first appear. (#7008)

This commit is contained in:
ocornut
2025-09-23 16:11:22 +02:00
parent e639ff392c
commit 8a0888c763
2 changed files with 4 additions and 1 deletions

View File

@@ -59,6 +59,8 @@ Docking+Viewports Branch:
- Nav: fixed a crash that could occur when opening a popup following the processing - 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 of a global shortcut while no windows were focused (the fix done in 1.92.3 was
incomplete for docking branch). 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: changed default value of io.ConfigViewportsNoDefaultParent to true. (#8948)
- Viewports: fixed an issue inferring Z-order when attempting to merge a viewport - Viewports: fixed an issue inferring Z-order when attempting to merge a viewport
back in the the main/hosting viewport. (#8948) back in the the main/hosting viewport. (#8948)

View File

@@ -16365,6 +16365,7 @@ static bool ImGui::UpdateTryMergeWindowIntoHostViewport(ImGuiWindow* window, ImG
if (g.Windows[n]->Viewport == old_viewport) if (g.Windows[n]->Viewport == old_viewport)
SetWindowViewport(g.Windows[n], viewport); SetWindowViewport(g.Windows[n], viewport);
SetWindowViewport(window, viewport); SetWindowViewport(window, viewport);
if ((window->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus) == 0)
BringWindowToDisplayFront(window); BringWindowToDisplayFront(window);
return true; return true;