1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-24 07:40:22 +01:00

Menus, Popup: Amend c3f8f4d for static analyzer warning ("condition always true"). (#7325)

This commit is contained in:
ocornut 2024-02-27 19:42:20 +01:00
parent c3f8f4de25
commit 44c7dfca03

View File

@ -10891,8 +10891,8 @@ void ImGui::ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_
if (restore_focus_to_window_under_popup && prev_popup.Window) if (restore_focus_to_window_under_popup && prev_popup.Window)
{ {
ImGuiWindow* popup_window = prev_popup.Window; ImGuiWindow* popup_window = prev_popup.Window;
ImGuiWindow* focus_window = (popup_window && popup_window->Flags & ImGuiWindowFlags_ChildMenu) ? popup_window->ParentWindow : prev_popup.RestoreNavWindow; ImGuiWindow* focus_window = (popup_window->Flags & ImGuiWindowFlags_ChildMenu) ? popup_window->ParentWindow : prev_popup.RestoreNavWindow;
if (focus_window && !focus_window->WasActive && popup_window) if (focus_window && !focus_window->WasActive)
FocusTopMostWindowUnderOne(popup_window, NULL, NULL, ImGuiFocusRequestFlags_RestoreFocusedChild); // Fallback FocusTopMostWindowUnderOne(popup_window, NULL, NULL, ImGuiFocusRequestFlags_RestoreFocusedChild); // Fallback
else else
FocusWindow(focus_window, (g.NavLayer == ImGuiNavLayer_Main) ? ImGuiFocusRequestFlags_RestoreFocusedChild : ImGuiFocusRequestFlags_None); FocusWindow(focus_window, (g.NavLayer == ImGuiNavLayer_Main) ? ImGuiFocusRequestFlags_RestoreFocusedChild : ImGuiFocusRequestFlags_None);