mirror of
https://github.com/ocornut/imgui.git
synced 2025-02-09 23:48:29 +01:00
EndMainMenuBar doesn't attempt to restore focus when there's an active id. (#8355)
I don't have a specific issue in mind but it seems sane to add that test.
This commit is contained in:
parent
dfd1bc3c5b
commit
a71191515a
@ -8769,7 +8769,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
|
// 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.
|
// FIXME: With this strategy we won't be able to restore a NULL focus.
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
if (g.CurrentWindow == g.NavWindow && g.NavLayer == ImGuiNavLayer_Main && !g.NavAnyRequest)
|
if (g.CurrentWindow == g.NavWindow && g.NavLayer == ImGuiNavLayer_Main && !g.NavAnyRequest && g.ActiveId == 0)
|
||||||
FocusTopMostWindowUnderOne(g.NavWindow, NULL, NULL, ImGuiFocusRequestFlags_UnlessBelowModal | ImGuiFocusRequestFlags_RestoreFocusedChild);
|
FocusTopMostWindowUnderOne(g.NavWindow, NULL, NULL, ImGuiFocusRequestFlags_UnlessBelowModal | ImGuiFocusRequestFlags_RestoreFocusedChild);
|
||||||
|
|
||||||
End();
|
End();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user