|
|
@ -3845,7 +3845,7 @@ void ImGui::NewFrame()
|
|
|
|
|
|
|
|
|
|
|
|
// Mark all windows as not visible and compact unused memory.
|
|
|
|
// Mark all windows as not visible and compact unused memory.
|
|
|
|
IM_ASSERT(g.WindowsFocusOrder.Size == g.Windows.Size);
|
|
|
|
IM_ASSERT(g.WindowsFocusOrder.Size == g.Windows.Size);
|
|
|
|
const float memory_compact_start_time = (g.IO.ConfigMemoryCompactTimer >= 0.0f) ? (float)g.Time - g.IO.ConfigMemoryCompactTimer : FLT_MAX;
|
|
|
|
const float memory_compact_start_time = (g.GcCompactAll || g.IO.ConfigMemoryCompactTimer < 0.0f) ? FLT_MAX : (float)g.Time - g.IO.ConfigMemoryCompactTimer;
|
|
|
|
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];
|
|
|
@ -3858,6 +3858,7 @@ void ImGui::NewFrame()
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g.GcCompactAll = false;
|
|
|
|
|
|
|
|
|
|
|
|
// Closing the focused window restore focus to the first active root window in descending z-order
|
|
|
|
// Closing the focused window restore focus to the first active root window in descending z-order
|
|
|
|
if (g.NavWindow && !g.NavWindow->WasActive)
|
|
|
|
if (g.NavWindow && !g.NavWindow->WasActive)
|
|
|
@ -6650,12 +6651,14 @@ void ImGui::ActivateItem(ImGuiID id)
|
|
|
|
g.NavNextActivateId = id;
|
|
|
|
g.NavNextActivateId = id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Note: this is storing in same stack as IDStack, so Push/Pop mismatch will be reported there.
|
|
|
|
// FIXME: this is storing in same stack as IDStack, so Push/Pop mismatch will be reported there. Maybe play nice and a separate in-context stack.
|
|
|
|
void ImGui::PushFocusScope(ImGuiID id)
|
|
|
|
void ImGui::PushFocusScope(ImGuiID id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
|
ImGuiWindow* window = g.CurrentWindow;
|
|
|
|
ImGuiWindow* window = g.CurrentWindow;
|
|
|
|
|
|
|
|
ImGuiID top_most_id = window->IDStack.back();
|
|
|
|
window->IDStack.push_back(window->DC.NavFocusScopeIdCurrent);
|
|
|
|
window->IDStack.push_back(window->DC.NavFocusScopeIdCurrent);
|
|
|
|
|
|
|
|
window->IDStack.push_back(top_most_id);
|
|
|
|
window->DC.NavFocusScopeIdCurrent = id;
|
|
|
|
window->DC.NavFocusScopeIdCurrent = id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -6665,6 +6668,8 @@ void ImGui::PopFocusScope()
|
|
|
|
ImGuiWindow* window = g.CurrentWindow;
|
|
|
|
ImGuiWindow* window = g.CurrentWindow;
|
|
|
|
window->DC.NavFocusScopeIdCurrent = window->IDStack.back();
|
|
|
|
window->DC.NavFocusScopeIdCurrent = window->IDStack.back();
|
|
|
|
window->IDStack.pop_back();
|
|
|
|
window->IDStack.pop_back();
|
|
|
|
|
|
|
|
IM_ASSERT(window->IDStack.Size > 1); // Too many PopID or PopFocusScope (or could be popping in a wrong/different window?)
|
|
|
|
|
|
|
|
window->IDStack.pop_back();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ImGui::SetKeyboardFocusHere(int offset)
|
|
|
|
void ImGui::SetKeyboardFocusHere(int offset)
|
|
|
@ -6763,6 +6768,7 @@ ImGuiID ImGui::GetIDWithSeed(const char* str, const char* str_end, ImGuiID seed)
|
|
|
|
void ImGui::PopID()
|
|
|
|
void ImGui::PopID()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ImGuiWindow* window = GImGui->CurrentWindow;
|
|
|
|
ImGuiWindow* window = GImGui->CurrentWindow;
|
|
|
|
|
|
|
|
IM_ASSERT(window->IDStack.Size > 1); // Too many PopID or PopFocusScope (or could be popping in a wrong/different window?)
|
|
|
|
window->IDStack.pop_back();
|
|
|
|
window->IDStack.pop_back();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -10323,12 +10329,14 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|
|
|
ImGuiMetricsConfig* cfg = &g.DebugMetricsConfig;
|
|
|
|
ImGuiMetricsConfig* cfg = &g.DebugMetricsConfig;
|
|
|
|
|
|
|
|
|
|
|
|
// Basic info
|
|
|
|
// Basic info
|
|
|
|
ImGui::Text("Dear ImGui %s", ImGui::GetVersion());
|
|
|
|
Text("Dear ImGui %s", ImGui::GetVersion());
|
|
|
|
ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate);
|
|
|
|
Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate);
|
|
|
|
ImGui::Text("%d vertices, %d indices (%d triangles)", io.MetricsRenderVertices, io.MetricsRenderIndices, io.MetricsRenderIndices / 3);
|
|
|
|
Text("%d vertices, %d indices (%d triangles)", io.MetricsRenderVertices, io.MetricsRenderIndices, io.MetricsRenderIndices / 3);
|
|
|
|
ImGui::Text("%d active windows (%d visible)", io.MetricsActiveWindows, io.MetricsRenderWindows);
|
|
|
|
Text("%d active windows (%d visible)", io.MetricsActiveWindows, io.MetricsRenderWindows);
|
|
|
|
ImGui::Text("%d active allocations", io.MetricsActiveAllocations);
|
|
|
|
Text("%d active allocations", io.MetricsActiveAllocations);
|
|
|
|
ImGui::Separator();
|
|
|
|
//SameLine(); if (SmallButton("GC")) { g.GcCompactAll = true; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Separator();
|
|
|
|
|
|
|
|
|
|
|
|
// Debugging enums
|
|
|
|
// Debugging enums
|
|
|
|
enum { WRT_OuterRect, WRT_OuterRectClipped, WRT_InnerRect, WRT_InnerClipRect, WRT_WorkRect, WRT_Content, WRT_ContentRegionRect, WRT_Count }; // Windows Rect Type
|
|
|
|
enum { WRT_OuterRect, WRT_OuterRectClipped, WRT_InnerRect, WRT_InnerClipRect, WRT_WorkRect, WRT_Content, WRT_ContentRegionRect, WRT_Count }; // Windows Rect Type
|
|
|
|