From 44c7dfca0304ba5ab22caf351203f84a16d206d9 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 27 Feb 2024 19:42:20 +0100 Subject: [PATCH] Menus, Popup: Amend c3f8f4d for static analyzer warning ("condition always true"). (#7325) --- imgui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 9648c7976..6a14012c3 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -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) { ImGuiWindow* popup_window = prev_popup.Window; - ImGuiWindow* focus_window = (popup_window && popup_window->Flags & ImGuiWindowFlags_ChildMenu) ? popup_window->ParentWindow : prev_popup.RestoreNavWindow; - if (focus_window && !focus_window->WasActive && popup_window) + ImGuiWindow* focus_window = (popup_window->Flags & ImGuiWindowFlags_ChildMenu) ? popup_window->ParentWindow : prev_popup.RestoreNavWindow; + if (focus_window && !focus_window->WasActive) FocusTopMostWindowUnderOne(popup_window, NULL, NULL, ImGuiFocusRequestFlags_RestoreFocusedChild); // Fallback else FocusWindow(focus_window, (g.NavLayer == ImGuiNavLayer_Main) ? ImGuiFocusRequestFlags_RestoreFocusedChild : ImGuiFocusRequestFlags_None);