Menus: Fix sub-menu inhibition stopping working in some cases. (Amend WIP) (#2517, #5614, noticed in #5546)
Amend bda2cde6
Fixes the case where following menu hover sequence results in incorrect RestoreNavWindow (previously SourceWindow) pointing to opened sub-menu:
1. Hover "Menu -> Options" - Open ##Menu_01 window
2. Hover "Menu -> Colors" - SourceWindow incorrectly points to ##Menu_01 window
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
ImGuiWindow*Window;// Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup()
ImGuiWindow*SourceWindow;// Set on OpenPopup() copy of NavWindow at the time of opening the popup
ImGuiWindow*BackupNavWindow;// Set on OpenPopup(), a NavWindow that will be restored on popup close
intParentNavLayer;// Resolved on BeginPopup(). Actually a ImGuiNavLayer type (declared down below), initialized to -1 which is not part of an enum, but serves well-enough as "not any of layers" value
intOpenFrameCount;// Set on OpenPopup()
ImGuiIDOpenParentId;// Set on OpenPopup(), we need this to differentiate multiple menu sets from each others (e.g. inside menu bar vs loose menu items)