mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Fixed crash when appending with BeginMainMenuBar() more than once and no other window are showing. (#2567) + comments
This commit is contained in:
parent
392ab08580
commit
882d2c3aea
3 changed files with 9 additions and 4 deletions
|
|
@ -5850,7 +5850,7 @@ void ImGui::EndMainMenuBar()
|
|||
// When the user has left the menu layer (typically: closed menus through activation of an item), we restore focus to the previous window
|
||||
// FIXME: With this strategy we won't be able to restore a NULL focus.
|
||||
ImGuiContext& g = *GImGui;
|
||||
if (g.CurrentWindow == g.NavWindow && g.NavLayer == 0)
|
||||
if (g.CurrentWindow == g.NavWindow && g.NavLayer == 0 && !g.NavAnyRequest)
|
||||
FocusTopMostWindowUnderOne(g.NavWindow, NULL);
|
||||
|
||||
End();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue