Menus: reuse more menu windows when stacked over popups.

This is actually mostly aimed at ensuring the _ChildWindow flag on menu window doesn't vary as this would cause issues with our current g.WindowsFocusOrder[] scheme
This commit is contained in:
ocornut
2021-12-13 19:35:16 +01:00
parent 0e8c199e87
commit 11638fdf7d
2 changed files with 7 additions and 1 deletions

View File

@ -1580,6 +1580,7 @@ struct ImGuiContext
ImVector<ImGuiGroupData>GroupStack; // Stack for BeginGroup()/EndGroup() - not inherited by Begin()
ImVector<ImGuiPopupData>OpenPopupStack; // Which popups are open (persistent)
ImVector<ImGuiPopupData>BeginPopupStack; // Which level of BeginPopup() we are in (reset every frame)
int BeginMenuCount;
// Viewports
ImVector<ImGuiViewportP*> Viewports; // Active viewports (Size==1 in 'master' branch). Each viewports hold their copy of ImDrawData.
@ -1801,6 +1802,7 @@ struct ImGuiContext
LastActiveIdTimer = 0.0f;
CurrentItemFlags = ImGuiItemFlags_None;
BeginMenuCount = 0;
NavWindow = NULL;
NavId = NavFocusScopeId = NavActivateId = NavActivateDownId = NavActivatePressedId = NavActivateInputId = 0;