Viewport: Misc comments following user feedbacks..

This commit is contained in:
omar
2018-12-21 18:40:16 +01:00
parent 9d0bc3f9ab
commit a71d3c8cb3
6 changed files with 23 additions and 8 deletions

View File

@ -3812,10 +3812,12 @@ void ImGui::EndFrame()
viewport->LastPos = viewport->Pos;
if (viewport->LastFrameActive < g.FrameCount || viewport->Size.x <= 0.0f || viewport->Size.y <= 0.0f)
continue;
if (viewport->Window && !IsWindowActiveAndVisible(viewport->Window))
if (viewport->Window && !IsWindowActiveAndVisible(viewport->Window)) // Will be destroyed in UpdatePlatformWindows()
continue;
if (i > 0)
IM_ASSERT(viewport->Window != NULL);
// Add to user-facing list
g.PlatformIO.Viewports.push_back(viewport);
}
g.Viewports[0]->ClearRequestFlags(); // Clear main viewport flags because UpdatePlatformWindows() won't do it and may not even be called
@ -7680,11 +7682,9 @@ void ImGui::UpdatePlatformWindows()
DestroyPlatformWindow(viewport);
continue;
}
if (viewport->LastFrameActive < g.FrameCount)
continue;
// New windows that appears directly in a new viewport won't always have a size on their first frame
if (viewport->Size.x <= 0 || viewport->Size.y <= 0)
if (viewport->LastFrameActive < g.FrameCount || viewport->Size.x <= 0 || viewport->Size.y <= 0)
continue;
// Update common viewport flags for owned viewports