mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
Viewport: Fixed a viewport bug which led some popups to merge in underlying host viewport when they should be z-over their parent viewport.
This commit is contained in:
@ -7487,10 +7487,6 @@ static void ImGui::UpdateSelectWindowViewport(ImGuiWindow* window)
|
||||
return;
|
||||
}
|
||||
|
||||
// Merge into host viewport
|
||||
bool try_to_merge_into_host_viewport = false;
|
||||
if (window->ViewportOwned && g.ActiveId == 0)
|
||||
try_to_merge_into_host_viewport = true;
|
||||
window->ViewportOwned = false;
|
||||
|
||||
// Appearing popups reset their viewport so they can inherit again
|
||||
@ -7541,6 +7537,9 @@ static void ImGui::UpdateSelectWindowViewport(ImGuiWindow* window)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Merge into host viewport?
|
||||
// We cannot test window->ViewportOwned as it set lower in the function.
|
||||
bool try_to_merge_into_host_viewport = (window->Viewport && window == window->Viewport->Window && g.ActiveId == 0);
|
||||
if (try_to_merge_into_host_viewport)
|
||||
UpdateTryMergeWindowIntoHostViewport(window, g.Viewports[0]);
|
||||
}
|
||||
@ -7594,7 +7593,7 @@ void ImGui::UpdatePlatformWindows()
|
||||
{
|
||||
ImGuiViewportP* viewport = g.Viewports[i];
|
||||
|
||||
// Destroy platform window if the viewport hasn't been submitted or if it is hosting a hidden window (the implicit Debug window will be registered its viewport then be disabled)
|
||||
// Destroy platform window if the viewport hasn't been submitted or if it is hosting a hidden window (the implicit/fallback Debug window will be registered its viewport then be disabled)
|
||||
bool destroy_platform_window = false;
|
||||
destroy_platform_window |= (viewport->LastFrameActive < g.FrameCount - 1);
|
||||
destroy_platform_window |= (viewport->Window && !IsWindowActiveAndVisible(viewport->Window));
|
||||
|
Reference in New Issue
Block a user