Răsfoiți Sursa

Viewport: Increased threshold for setting ImGuiViewportFlags_NoFocusOnAppearing. (#1542), 2 doesn't seem enough with some docking setup.

omar 7 ani în urmă
părinte
comite
132d8c5a99
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      imgui.cpp

+ 1 - 1
imgui.cpp

@@ -7552,7 +7552,7 @@ void ImGui::UpdatePlatformWindows()
         // Show window. On startup ensure platform window don't get focus
         // Show window. On startup ensure platform window don't get focus
         if (is_new_window)
         if (is_new_window)
         {
         {
-            if (g.FrameCount < 2)
+            if (g.FrameCount < 3) // Give a few frames for the application to stabilize (nested contents may lead to viewport being created a few frames late)
                 viewport->Flags |= ImGuiViewportFlags_NoFocusOnAppearing;
                 viewport->Flags |= ImGuiViewportFlags_NoFocusOnAppearing;
             g.PlatformIO.Platform_ShowWindow(viewport);
             g.PlatformIO.Platform_ShowWindow(viewport);
         }
         }