diff --git a/imgui.cpp b/imgui.cpp index 763d58d2e..cae05b0e4 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -7419,7 +7419,6 @@ static void ImGui::UpdateViewportsNewFrame() ImGuiContext& g = *GImGui; IM_ASSERT(g.PlatformIO.Viewports.Size <= g.Viewports.Size); - // Update main viewport with current platform position and size ImGuiViewportP* main_viewport = g.Viewports[0]; IM_ASSERT(main_viewport->ID == IMGUI_VIEWPORT_DEFAULT_ID); IM_ASSERT(main_viewport->Window == NULL); @@ -7461,9 +7460,6 @@ static void ImGui::UpdateViewportsNewFrame() const bool platform_funcs_available = (n == 0 || viewport->PlatformWindowCreated); if ((g.ConfigFlagsForFrame & ImGuiConfigFlags_ViewportsEnable)) { - if (g.PlatformIO.Platform_GetWindowMinimized && platform_funcs_available) - viewport->PlatformWindowMinimized = g.PlatformIO.Platform_GetWindowMinimized(viewport); - // Update Position and Size (from Platform Window to ImGui) if requested. // We do it early in the frame instead of waiting for UpdatePlatformWindows() to avoid a frame of lag when moving/resizing using OS facilities. if (!viewport->PlatformWindowMinimized && platform_funcs_available) @@ -7577,7 +7573,8 @@ static void ImGui::UpdateViewportsEndFrame() ImGuiViewportP* viewport = g.Viewports[i]; viewport->LastPos = viewport->Pos; if (viewport->LastFrameActive < g.FrameCount || viewport->Size.x <= 0.0f || viewport->Size.y <= 0.0f) - continue; + if (i > 0) // Always include main viewport in the list + continue; if (viewport->Window && !IsWindowActiveAndVisible(viewport->Window)) continue; if (i > 0)