diff --git a/src/core/fullscreen_ui.cpp b/src/core/fullscreen_ui.cpp index 100edb966..706e2addf 100644 --- a/src/core/fullscreen_ui.cpp +++ b/src/core/fullscreen_ui.cpp @@ -4659,7 +4659,8 @@ void FullscreenUI::DrawControllerSettingsPage() ImGui::SetNextWindowSize(LayoutScale(500.0f, 180.0f)); - if (BeginFixedPopupModal(freq_label, nullptr)) + bool is_open = true; + if (BeginFixedPopupModal(freq_label, &is_open)) { ImGui::SetNextItemWidth(LayoutScale(450.0f)); if (ImGui::SliderInt("##value", &frequency, 0, 60, FSUI_CSTR("Toggle every %d frames"), diff --git a/src/util/imgui_fullscreen.cpp b/src/util/imgui_fullscreen.cpp index 8d79544ee..b945abe55 100644 --- a/src/util/imgui_fullscreen.cpp +++ b/src/util/imgui_fullscreen.cpp @@ -650,6 +650,12 @@ bool ImGuiFullscreen::BeginFixedPopupModal(const char* name, bool* p_open) return false; } + if (p_open && *p_open && WantsToCloseMenu()) + { + *p_open = false; + ImGui::CloseCurrentPopup(); + } + // don't draw unreadable text ImGui::PushStyleColor(ImGuiCol_Text, UIStyle.BackgroundTextColor); return true; @@ -2816,6 +2822,9 @@ void ImGuiFullscreen::DrawMessageDialog() if (ImGui::BeginPopupModal(win_id, &is_open, flags)) { + if (WantsToCloseMenu()) + is_open = false; + ImGui::PushStyleColor(ImGuiCol_Text, UIStyle.BackgroundTextColor); ResetFocusHere();