mirror of
https://github.com/ocornut/imgui.git
synced 2026-02-07 04:30:08 +00:00
Nav, Docking, Selection: Fixed tab change from reinitializing navigation state. (#8997)
This commit is contained in:
parent
28ed29078b
commit
96ad003000
2 changed files with 7 additions and 3 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue