Skip to content

Commit

Permalink
Window refresh policy: fixed child window of skiprefresh windows not …
Browse files Browse the repository at this point in the history
ocornut committed Aug 1, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
addaleax Anna Henningsen
1 parent 9f8f5e1 commit 531364d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion imgui.cpp
Original file line number Diff line number Diff line change
@@ -6531,6 +6531,17 @@ void ImGui::UpdateWindowSkipRefresh(ImGuiWindow* window)
}
}

static void SetWindowActiveForSkipRefresh(ImGuiWindow* window)
{
window->Active = true;
for (ImGuiWindow* child : window->DC.ChildWindows)
if (!child->Hidden)
{
child->Active = child->SkipRefresh = true;
SetWindowActiveForSkipRefresh(child);
}
}

// When a modal popup is open, newly created windows that want focus (i.e. are not popups and do not specify ImGuiWindowFlags_NoFocusOnAppearing)
// should be positioned behind that modal window, unless the window was created inside the modal begin-stack.
// 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)
{
// Skip refresh always mark active
if (window->SkipRefresh)
window->Active = true;
SetWindowActiveForSkipRefresh(window);

// Append
SetCurrentWindow(window);

0 comments on commit 531364d

Please sign in to comment.