TabBar: fixed calling TabBarQueueFocus() before submitting tabs. (#8929, #6681)

This commit is contained in:
ocornut
2025-09-10 18:03:34 +02:00
parent 4e98fb20e2
commit 1cd08b883c
3 changed files with 5 additions and 2 deletions

View File

@@ -9908,7 +9908,8 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
tab_bar->TabsNames.Buf.resize(0);
// If we have lost the selected tab, select the next most recently active one
if (found_selected_tab_id == false)
const bool tab_bar_appearing = (tab_bar->PrevFrameVisible + 1 < g.FrameCount);
if (found_selected_tab_id == false && !tab_bar_appearing)
tab_bar->SelectedTabId = 0;
if (tab_bar->SelectedTabId == 0 && tab_bar->NextSelectedTabId == 0 && most_recently_selected_tab != NULL)
scroll_to_tab_id = tab_bar->SelectedTabId = most_recently_selected_tab->ID;