mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-12 00:14:20 +00:00
Viewports: fixed issue in UpdateTryMergeWindowIntoHostViewport(). (#8948)
Amend dfe308b
This commit is contained in:
parent
50a8bb2711
commit
e7aa0dec5b
1 changed files with 4 additions and 2 deletions
|
|
@ -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,8 +16363,9 @@ 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()))
|
||||||
return false;
|
if (IsViewportAbove(viewport_2, viewport) && !IsViewportAbove(viewport_2, window->Viewport))
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move to the existing viewport, Move child/hosted windows as well (FIXME-OPT: iterate child)
|
// Move to the existing viewport, Move child/hosted windows as well (FIXME-OPT: iterate child)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue