WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 531364d

Browse files
committed
Window refresh policy: fixed child window of skiprefresh windows not displaying. (#7797)
Amend d449544. (#3515, #4763, #7556, #5116 , #4076, #2749, #2268)
1 parent 9f8f5e1 commit 531364d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

imgui.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6531,6 +6531,17 @@ void ImGui::UpdateWindowSkipRefresh(ImGuiWindow* window)
65316531
}
65326532
}
65336533

6534+
static void SetWindowActiveForSkipRefresh(ImGuiWindow* window)
6535+
{
6536+
window->Active = true;
6537+
for (ImGuiWindow* child : window->DC.ChildWindows)
6538+
if (!child->Hidden)
6539+
{
6540+
child->Active = child->SkipRefresh = true;
6541+
SetWindowActiveForSkipRefresh(child);
6542+
}
6543+
}
6544+
65346545
// When a modal popup is open, newly created windows that want focus (i.e. are not popups and do not specify ImGuiWindowFlags_NoFocusOnAppearing)
65356546
// should be positioned behind that modal window, unless the window was created inside the modal begin-stack.
65366547
// In case of multiple stacked modals newly created window honors begin stack order and does not go below its own modal parent.
@@ -7233,7 +7244,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
72337244
{
72347245
// Skip refresh always mark active
72357246
if (window->SkipRefresh)
7236-
window->Active = true;
7247+
SetWindowActiveForSkipRefresh(window);
72377248

72387249
// Append
72397250
SetCurrentWindow(window);

0 commit comments

Comments
 (0)