Skip to content

Commit 4bac7cb

Browse files
committed
FullscreenUI: Fix some dialogs not being cancellable
i.e. exitable with right mouse click/B button.
1 parent db3b689 commit 4bac7cb

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/core/fullscreen_ui.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4659,7 +4659,8 @@ void FullscreenUI::DrawControllerSettingsPage()
46594659

46604660
ImGui::SetNextWindowSize(LayoutScale(500.0f, 180.0f));
46614661

4662-
if (BeginFixedPopupModal(freq_label, nullptr))
4662+
bool is_open = true;
4663+
if (BeginFixedPopupModal(freq_label, &is_open))
46634664
{
46644665
ImGui::SetNextItemWidth(LayoutScale(450.0f));
46654666
if (ImGui::SliderInt("##value", &frequency, 0, 60, FSUI_CSTR("Toggle every %d frames"),

src/util/imgui_fullscreen.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,12 @@ bool ImGuiFullscreen::BeginFixedPopupModal(const char* name, bool* p_open)
650650
return false;
651651
}
652652

653+
if (p_open && *p_open && WantsToCloseMenu())
654+
{
655+
*p_open = false;
656+
ImGui::CloseCurrentPopup();
657+
}
658+
653659
// don't draw unreadable text
654660
ImGui::PushStyleColor(ImGuiCol_Text, UIStyle.BackgroundTextColor);
655661
return true;
@@ -2816,6 +2822,9 @@ void ImGuiFullscreen::DrawMessageDialog()
28162822

28172823
if (ImGui::BeginPopupModal(win_id, &is_open, flags))
28182824
{
2825+
if (WantsToCloseMenu())
2826+
is_open = false;
2827+
28192828
ImGui::PushStyleColor(ImGuiCol_Text, UIStyle.BackgroundTextColor);
28202829

28212830
ResetFocusHere();

0 commit comments

Comments
 (0)