IM_ASSERT(g.CurrentTabBar!=tab_bar);// Can't work while the tab bar is active as our tab doesn't have an X offset yet, in theory we could/should test something like (tab_bar->CurrFrameVisible < g.FrameCount) but we'd need to solve why triggers the commented early-out assert in BeginTabBarEx() (probably dock node going from implicit to explicit in same frame)
if(!window->HasCloseButton)
tab_flags|=ImGuiTabItemFlags_NoCloseButton;// Set _NoCloseButton immediately because it will be used for first-frame width calculation.