Menus: Separate menu sets by nav layer. (#3496, #4797) + Demo: Remove incorrect and useless suggestion to use PushID().

Fixes a common case where opening menu in one nav layer and hovering a menu in another nav layer would open that menu without a click.
This commit is contained in:
Rokas Kupstys
2022-06-08 12:34:35 +03:00
committed by ocornut
parent a35e876978
commit 0b1bcfcc20
5 changed files with 13 additions and 11 deletions

View File

@ -6071,6 +6071,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
{
ImGuiPopupData& popup_ref = g.OpenPopupStack[g.BeginPopupStack.Size];
popup_ref.Window = window;
popup_ref.ParentNavLayer = parent_window_in_stack->DC.NavLayerCurrent;
g.BeginPopupStack.push_back(popup_ref);
window->PopupId = popup_ref.PopupId;
}