Skip to content

Commit

Permalink
Window refresh policy: extend tests to any window in the begin stack. (
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Aug 1, 2024
1 parent 531364d commit 6864a7f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6522,10 +6522,12 @@ void ImGui::UpdateWindowSkipRefresh(ImGuiWindow* window)
return;
if (window->Hidden) // If was hidden (previous frame)
return;
if ((g.NextWindowData.RefreshFlagsVal & ImGuiWindowRefreshFlags_RefreshOnHover) && g.HoveredWindow && window->RootWindow == g.HoveredWindow->RootWindow)
return;
if ((g.NextWindowData.RefreshFlagsVal & ImGuiWindowRefreshFlags_RefreshOnFocus) && g.NavWindow && window->RootWindow == g.NavWindow->RootWindow)
return;
if ((g.NextWindowData.RefreshFlagsVal & ImGuiWindowRefreshFlags_RefreshOnHover) && g.HoveredWindow)
if (window->RootWindow == g.HoveredWindow->RootWindow || IsWindowWithinBeginStackOf(g.HoveredWindow->RootWindow, window))
return;
if ((g.NextWindowData.RefreshFlagsVal & ImGuiWindowRefreshFlags_RefreshOnFocus) && g.NavWindow)
if (window->RootWindow == g.NavWindow->RootWindow || IsWindowWithinBeginStackOf(g.NavWindow->RootWindow, window))
return;
window->DrawList = NULL;
window->SkipRefresh = true;
}
Expand Down

0 comments on commit 6864a7f

Please sign in to comment.