From 403606bbcb8b4b2c47f76b619e78350004707ece Mon Sep 17 00:00:00 2001 From: Valiantsin Dzerakh Date: Tue, 27 Oct 2026 15:24:14 +0300 Subject: [PATCH] The settings menu draws over the performance overlay while it is open Co-Authored-By: Claude Opus 5.5 --- runtime/ui/menu.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/runtime/ui/menu.cpp b/runtime/ui/menu.cpp index 4ec8dc5f..db50bcda 100644 --- a/runtime/ui/menu.cpp +++ b/runtime/ui/menu.cpp @@ -956,7 +956,9 @@ static void perf_full_draw(const MenuTarget *t, float scale) { ImGui::Begin("##perf", nullptr, ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoSavedSettings); - ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindow()); // over the menu while it is open + // under the menu while it is open (the settings stay readable), else over everything + if (g_open.load(std::memory_order_relaxed)) ImGui::BringWindowToDisplayBack(ImGui::GetCurrentWindow()); + else ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindow()); ImGui::SetWindowFontScale(0.72f); const ImVec4 gpu_c(0.55f, 0.83f, 0.31f, 1), cpu_c(0.18f, 0.59f, 0.80f, 1), ram_c(0.80f, 0.45f, 0.70f, 1), fps_c(0.95f, 0.95f, 0.95f, 1), wait_c(0.93f, 0.76f, 0.33f, 1), pic_c(0.62f, 0.70f, 0.95f, 1); @@ -1029,7 +1031,8 @@ static void perf_draw(const MenuTarget *t, float scale) { if (g_perf_mode == 2) return perf_full_draw(t, scale); float w = (float)t->width; if (!g_perf_mode || !g_perf_text[0]) return; - ImDrawList *dl = ImGui::GetForegroundDrawList(); + // with the menu open: under its window, over the dimming layout_menu drew before + ImDrawList *dl = g_open.load(std::memory_order_relaxed) ? ImGui::GetBackgroundDrawList() : ImGui::GetForegroundDrawList(); ImVec2 sz = ImGui::CalcTextSize(g_perf_text); float pad = 6 * scale; ImVec2 p(w - 12 * scale - sz.x - pad * 2, 12 * scale); // the top right corner: the game's HUD leaves it empty