Skip to content

Commit

Permalink
Menus, Popup: Amend c3f8f4d for static analyzer warning ("condition a…
Browse files Browse the repository at this point in the history
…lways true"). (#7325)
  • Loading branch information
ocornut committed Feb 27, 2024
1 parent c3f8f4d commit 44c7dfc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 44c7dfc

Please sign in to comment.