mirror of
https://github.com/ocornut/imgui.git
synced 2025-10-03 16:46:29 +00:00
Viewports: fixed issue in UpdateTryMergeWindowIntoHostViewport(). (#8948)
Amend dfe308b
This commit is contained in:
@@ -16337,6 +16337,7 @@ static bool ImGui::GetWindowAlwaysWantOwnViewport(ImGuiWindow* window)
|
|||||||
|
|
||||||
|
|
||||||
// Heuristic, see #8948: depends on how backends handle OS-level parenting.
|
// Heuristic, see #8948: depends on how backends handle OS-level parenting.
|
||||||
|
// FIXME-VIEWPORTS: if ImGuiBackendFlags_HasParentViewportId if set, we should consider ->ParentViewportId as primary source of truth.
|
||||||
static bool IsViewportAbove(ImGuiViewportP* potential_above, ImGuiViewportP* potential_below)
|
static bool IsViewportAbove(ImGuiViewportP* potential_above, ImGuiViewportP* potential_below)
|
||||||
{
|
{
|
||||||
if (potential_above->LastFocusedStampCount > potential_below->LastFocusedStampCount || potential_above->ParentViewportId == potential_below->ID) // FIXME: Should follow the ParentViewportId list.
|
if (potential_above->LastFocusedStampCount > potential_below->LastFocusedStampCount || potential_above->ParentViewportId == potential_below->ID) // FIXME: Should follow the ParentViewportId list.
|
||||||
@@ -16362,7 +16363,8 @@ static bool ImGui::UpdateTryMergeWindowIntoHostViewport(ImGuiWindow* window, ImG
|
|||||||
{
|
{
|
||||||
if (viewport_2 == viewport || viewport_2 == window->Viewport)
|
if (viewport_2 == viewport || viewport_2 == window->Viewport)
|
||||||
continue;
|
continue;
|
||||||
if (IsViewportAbove(viewport_2, viewport) && viewport_2->GetMainRect().Overlaps(window->Rect()))
|
if (viewport_2->GetMainRect().Overlaps(window->Rect()))
|
||||||
|
if (IsViewportAbove(viewport_2, viewport) && !IsViewportAbove(viewport_2, window->Viewport))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user