if(popup_window==NULL||!popup_window->WasActive||!(popup_window->Flags&ImGuiWindowFlags_Modal))// Check WasActive, because this code may run before popup renders on current frame.
if(!popup_window->Active&&!popup_window->WasActive)// Check WasActive, because this code may run before popup renders on current frame, also check Active to handle newly created windows.
continue;
if(IsWindowWithinBeginStackOf(window,popup_window))// Window is rendered over last modal, no render order change needed.
// (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)