mirror of
https://github.com/ocornut/imgui.git
synced 2026-08-03 14:19:25 +00:00
Merge branch 'master' into docking (multi-viewport broken until next commit)
# Conflicts: # backends/imgui_impl_sdl2.cpp # backends/imgui_impl_sdl3.cpp
This commit is contained in:
23
imgui.cpp
23
imgui.cpp
@@ -6896,15 +6896,28 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
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.
|
||||
@@ -7758,7 +7771,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
|
||||
SetCurrentViewport(window, window->Viewport);
|
||||
|
||||
Reference in New Issue
Block a user