Skip to content

Commit

Permalink
Viewport: Popups and Tooltips viewports are correctly parented to the…
Browse files Browse the repository at this point in the history
… parent window's viewport. (#2409, #1542)
  • Loading branch information
ocornut committed Mar 11, 2019
1 parent f7db4fa commit 3ead982
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5623,6 +5623,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// We don't default to the main viewport because.
if (window->WindowClass.ParentViewportId)
window->Viewport->ParentViewportId = window->WindowClass.ParentViewportId;
else if ((flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_Tooltip)) && parent_window_in_stack)
window->Viewport->ParentViewportId = parent_window_in_stack->Viewport->ID;
else
window->Viewport->ParentViewportId = g.IO.ConfigViewportsNoDefaultParent ? 0 : IMGUI_VIEWPORT_DEFAULT_ID;
if (window->WindowClass.ViewportFlagsOverrideMask)
Expand Down

0 comments on commit 3ead982

Please sign in to comment.