Window, Nav: Fixed crash when calling SetWindowFocus(NULL) as the time a new window appears. (#3865)

This commit is contained in:
ocornut
2021-03-02 18:22:01 +01:00
parent 4537d98d46
commit 25679a411e
3 changed files with 4 additions and 2 deletions

View File

@ -6372,11 +6372,12 @@ void ImGui::FocusWindow(ImGuiWindow* window)
g.NavWindow = window;
if (window && g.NavDisableMouseHover)
g.NavMousePosDirty = true;
g.NavInitRequest = false;
g.NavId = window ? window->NavLastIds[0] : 0; // Restore NavId
g.NavFocusScopeId = 0;
g.NavIdIsAlive = false;
g.NavLayer = ImGuiNavLayer_Main;
g.NavInitRequest = g.NavMoveRequest = false;
NavUpdateAnyRequestFlag();
//IMGUI_DEBUG_LOG("FocusWindow(\"%s\")\n", window ? window->Name : NULL);
}