diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index fe785c9fc..aab1c1f69 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -71,6 +71,8 @@ Other Changes: unmoved. We revert back to move to the end of line in this situation. - Selectable: added ImGuiSelectableFlags_SelectOnNav to auto-select an item when moved into (automatic when in a BeginMultiSelect() block). +- TabBar: fixed an issue were forcefully selecting a tab using internal API would + be ignored on first/appearing frame before tabs are submitted (#8929, #6681) - DrawList: fixed CloneOutput() unnecessarily taking a copy of the ImDrawListSharedData pointer, which could to issue when deleting the cloned list. (#8894, #1860) - DrawList: made AddCallback() assert when passing a null callback. diff --git a/imgui.h b/imgui.h index a9aea86ed..a087c9e4d 100644 --- a/imgui.h +++ b/imgui.h @@ -29,7 +29,7 @@ // Library Version // (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345') #define IMGUI_VERSION "1.92.3 WIP" -#define IMGUI_VERSION_NUM 19226 +#define IMGUI_VERSION_NUM 19227 #define IMGUI_HAS_TABLE // Added BeginTable() - from IMGUI_VERSION_NUM >= 18000 #define IMGUI_HAS_TEXTURES // Added ImGuiBackendFlags_RendererHasTextures - from IMGUI_VERSION_NUM >= 19198 diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index c405d2f2d..53167ea69 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -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;