|
@@ -3768,7 +3768,7 @@ void ImGui::NewFrame()
|
|
|
window->Active = false;
|
|
window->Active = false;
|
|
|
window->WriteAccessed = false;
|
|
window->WriteAccessed = false;
|
|
|
|
|
|
|
|
- // Garbage collect (this is totally functional but we may need decide if the side-effects are desirable)
|
|
|
|
|
|
|
+ // Garbage collect transient buffers of recently unused windows
|
|
|
if (!window->WasActive && !window->MemoryCompacted && window->LastTimeActive < memory_compact_start_time)
|
|
if (!window->WasActive && !window->MemoryCompacted && window->LastTimeActive < memory_compact_start_time)
|
|
|
GcCompactTransientWindowBuffers(window);
|
|
GcCompactTransientWindowBuffers(window);
|
|
|
}
|
|
}
|
|
@@ -3889,7 +3889,7 @@ void ImGui::Shutdown(ImGuiContext* context)
|
|
|
IM_DELETE(g.Windows[i]);
|
|
IM_DELETE(g.Windows[i]);
|
|
|
g.Windows.clear();
|
|
g.Windows.clear();
|
|
|
g.WindowsFocusOrder.clear();
|
|
g.WindowsFocusOrder.clear();
|
|
|
- g.WindowsSortBuffer.clear();
|
|
|
|
|
|
|
+ g.WindowsTempSortBuffer.clear();
|
|
|
g.CurrentWindow = NULL;
|
|
g.CurrentWindow = NULL;
|
|
|
g.CurrentWindowStack.clear();
|
|
g.CurrentWindowStack.clear();
|
|
|
g.WindowsById.Clear();
|
|
g.WindowsById.Clear();
|
|
@@ -4125,19 +4125,19 @@ void ImGui::EndFrame()
|
|
|
|
|
|
|
|
// Sort the window list so that all child windows are after their parent
|
|
// Sort the window list so that all child windows are after their parent
|
|
|
// We cannot do that on FocusWindow() because childs may not exist yet
|
|
// We cannot do that on FocusWindow() because childs may not exist yet
|
|
|
- g.WindowsSortBuffer.resize(0);
|
|
|
|
|
- g.WindowsSortBuffer.reserve(g.Windows.Size);
|
|
|
|
|
|
|
+ g.WindowsTempSortBuffer.resize(0);
|
|
|
|
|
+ g.WindowsTempSortBuffer.reserve(g.Windows.Size);
|
|
|
for (int i = 0; i != g.Windows.Size; i++)
|
|
for (int i = 0; i != g.Windows.Size; i++)
|
|
|
{
|
|
{
|
|
|
ImGuiWindow* window = g.Windows[i];
|
|
ImGuiWindow* window = g.Windows[i];
|
|
|
if (window->Active && (window->Flags & ImGuiWindowFlags_ChildWindow)) // if a child is active its parent will add it
|
|
if (window->Active && (window->Flags & ImGuiWindowFlags_ChildWindow)) // if a child is active its parent will add it
|
|
|
continue;
|
|
continue;
|
|
|
- AddWindowToSortBuffer(&g.WindowsSortBuffer, window);
|
|
|
|
|
|
|
+ AddWindowToSortBuffer(&g.WindowsTempSortBuffer, window);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// This usually assert if there is a mismatch between the ImGuiWindowFlags_ChildWindow / ParentWindow values and DC.ChildWindows[] in parents, aka we've done something wrong.
|
|
// This usually assert if there is a mismatch between the ImGuiWindowFlags_ChildWindow / ParentWindow values and DC.ChildWindows[] in parents, aka we've done something wrong.
|
|
|
- IM_ASSERT(g.Windows.Size == g.WindowsSortBuffer.Size);
|
|
|
|
|
- g.Windows.swap(g.WindowsSortBuffer);
|
|
|
|
|
|
|
+ IM_ASSERT(g.Windows.Size == g.WindowsTempSortBuffer.Size);
|
|
|
|
|
+ g.Windows.swap(g.WindowsTempSortBuffer);
|
|
|
g.IO.MetricsActiveWindows = g.WindowsActiveCount;
|
|
g.IO.MetricsActiveWindows = g.WindowsActiveCount;
|
|
|
|
|
|
|
|
// Unlock font atlas
|
|
// Unlock font atlas
|
|
@@ -5163,10 +5163,14 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar
|
|
|
if (!(flags & ImGuiWindowFlags_NoBackground))
|
|
if (!(flags & ImGuiWindowFlags_NoBackground))
|
|
|
{
|
|
{
|
|
|
ImU32 bg_col = GetColorU32(GetWindowBgColorIdxFromFlags(flags));
|
|
ImU32 bg_col = GetColorU32(GetWindowBgColorIdxFromFlags(flags));
|
|
|
|
|
+ bool override_alpha = false;
|
|
|
float alpha = 1.0f;
|
|
float alpha = 1.0f;
|
|
|
if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasBgAlpha)
|
|
if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasBgAlpha)
|
|
|
|
|
+ {
|
|
|
alpha = g.NextWindowData.BgAlphaVal;
|
|
alpha = g.NextWindowData.BgAlphaVal;
|
|
|
- if (alpha != 1.0f)
|
|
|
|
|
|
|
+ override_alpha = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (override_alpha)
|
|
|
bg_col = (bg_col & ~IM_COL32_A_MASK) | (IM_F32_TO_INT8_SAT(alpha) << IM_COL32_A_SHIFT);
|
|
bg_col = (bg_col & ~IM_COL32_A_MASK) | (IM_F32_TO_INT8_SAT(alpha) << IM_COL32_A_SHIFT);
|
|
|
window->DrawList->AddRectFilled(window->Pos + ImVec2(0, window->TitleBarHeight()), window->Pos + window->Size, bg_col, window_rounding, (flags & ImGuiWindowFlags_NoTitleBar) ? ImDrawCornerFlags_All : ImDrawCornerFlags_Bot);
|
|
window->DrawList->AddRectFilled(window->Pos + ImVec2(0, window->TitleBarHeight()), window->Pos + window->Size, bg_col, window_rounding, (flags & ImGuiWindowFlags_NoTitleBar) ? ImDrawCornerFlags_All : ImDrawCornerFlags_Bot);
|
|
|
}
|
|
}
|
|
@@ -8764,7 +8768,7 @@ static void ImGui::NavUpdateWindowing()
|
|
|
if (start_windowing_with_gamepad || start_windowing_with_keyboard)
|
|
if (start_windowing_with_gamepad || start_windowing_with_keyboard)
|
|
|
if (ImGuiWindow* window = g.NavWindow ? g.NavWindow : FindWindowNavFocusable(g.WindowsFocusOrder.Size - 1, -INT_MAX, -1))
|
|
if (ImGuiWindow* window = g.NavWindow ? g.NavWindow : FindWindowNavFocusable(g.WindowsFocusOrder.Size - 1, -INT_MAX, -1))
|
|
|
{
|
|
{
|
|
|
- g.NavWindowingTarget = g.NavWindowingTargetAnim = window;
|
|
|
|
|
|
|
+ g.NavWindowingTarget = g.NavWindowingTargetAnim = window->RootWindow; // FIXME-DOCK: Will need to use RootWindowDockStop
|
|
|
g.NavWindowingTimer = g.NavWindowingHighlightAlpha = 0.0f;
|
|
g.NavWindowingTimer = g.NavWindowingHighlightAlpha = 0.0f;
|
|
|
g.NavWindowingToggleLayer = start_windowing_with_keyboard ? false : true;
|
|
g.NavWindowingToggleLayer = start_windowing_with_keyboard ? false : true;
|
|
|
g.NavInputSource = start_windowing_with_keyboard ? ImGuiInputSource_NavKeyboard : ImGuiInputSource_NavGamepad;
|
|
g.NavInputSource = start_windowing_with_keyboard ? ImGuiInputSource_NavKeyboard : ImGuiInputSource_NavGamepad;
|
|
@@ -10117,6 +10121,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
Funcs::NodeWindows(g.Windows, "Windows");
|
|
Funcs::NodeWindows(g.Windows, "Windows");
|
|
|
|
|
+ //Funcs::NodeWindows(g.WindowsFocusOrder, "WindowsFocusOrder");
|
|
|
if (ImGui::TreeNode("DrawLists", "Active DrawLists (%d)", g.DrawDataBuilder.Layers[0].Size))
|
|
if (ImGui::TreeNode("DrawLists", "Active DrawLists (%d)", g.DrawDataBuilder.Layers[0].Size))
|
|
|
{
|
|
{
|
|
|
for (int i = 0; i < g.DrawDataBuilder.Layers[0].Size; i++)
|
|
for (int i = 0; i < g.DrawDataBuilder.Layers[0].Size; i++)
|