Skip to content

Commit

Permalink
Fixed IsWindowFocused/IsWindowHovered with _ChildWindows for not foll…
Browse files Browse the repository at this point in the history
…owing through popup parents (amend 6b1e094, fix #4527)
  • Loading branch information
ocornut committed Sep 11, 2021
1 parent 79d39b1 commit 92a39f7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7268,8 +7268,11 @@ bool ImGui::IsWindowChildOf(ImGuiWindow* window, ImGuiWindow* potential_parent,
{
if (window == potential_parent)
return true;
if (window == (dock_hierarchy ? window->RootWindowDockTree : window->RootWindow))
return false;
// 2021-09-11: we broke the unexpressed contract that this function (prior to 6b1e094, #4527)
// would follow through popup parents as well. Restoring this for now. May want to add a ImGuiFocusedFlags_PopupHierarchy flag later.
if ((window->Flags & ImGuiWindowFlags_Popup) == 0)
if (window == (dock_hierarchy ? window->RootWindowDockTree : window->RootWindow))
return false;
window = window->ParentWindow;
}
return false;
Expand Down

0 comments on commit 92a39f7

Please sign in to comment.