diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 6db8ee44a..fae4d30b7 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -140,7 +140,10 @@ Other Changes: Docking+Viewports Branch: -- Nav: fixed a crash that could occur when opening a popup following the processing +- Nav, Docking, Selection: Fixed tab change from reinitializing navigation state, + which would erroneously clear selection when using ImGuiSelectableFlags_SelectOnNav + or clear multi-selection when not using ImGuiMultiSelectFlags_NoAutoSelect. (#8997) +- Nav: Fixed a crash that could occur when opening a popup following the processing of a global shortcut while no windows were focused (the fix done in 1.92.3 was incomplete for docking branch). - Viewports: diff --git a/imgui.cpp b/imgui.cpp index 4b30a0353..8df079f41 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -14953,7 +14953,7 @@ static void ImGui::NavUpdateWindowingApplyFocus(ImGuiWindow* apply_focus_window) FocusWindow(apply_focus_window, ImGuiFocusRequestFlags_RestoreFocusedChild); IM_ASSERT(g.NavWindow != NULL); apply_focus_window = g.NavWindow; - if (apply_focus_window->NavLastIds[0] == 0) + if (apply_focus_window->NavLastIds[0] == 0) // FIXME: This is the equivalent of the 'if (g.NavId == 0) { NavInitWindow() }' in DockNodeUpdateTabBar(). NavInitWindow(apply_focus_window, false); // If the window has ONLY a menu layer (no main layer), select it directly @@ -19366,7 +19366,8 @@ static void ImGui::DockNodeUpdateTabBar(ImGuiDockNode* node, ImGuiWindow* host_w if (tab->Window) { FocusWindow(tab->Window); - NavInitWindow(tab->Window, false); + if (g.NavId == 0) // only init if FocusWindow() didn't restore anything. + NavInitWindow(tab->Window, false); } EndTabBar();