From 85c284164339500929b9c42fcdac8e0dcc8b5ec3 Mon Sep 17 00:00:00 2001 From: Silent Date: Sun, 10 Nov 2019 23:58:39 +0100 Subject: Make "Do you want to stop emulation?" application modal and disallow multiple instances at once Fixes numerous issues with this dialog spawning multiple times and putting Dolphin in a weird state. --- Source/Core/DolphinQt/MainWindow.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Source/Core/DolphinQt/MainWindow.cpp') diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index bd1bbce1df..7216b00206 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -30,6 +30,7 @@ #include #endif +#include "Common/ScopeGuard.h" #include "Common/Version.h" #include "Common/WindowSystemInfo.h" @@ -785,6 +786,11 @@ bool MainWindow::RequestStop() if (SConfig::GetInstance().bConfirmStop) { + if (std::exchange(m_stop_confirm_showing, true)) + return true; + + Common::ScopeGuard confirm_lock([this] { m_stop_confirm_showing = false; }); + const Core::State state = Core::GetState(); // Only pause the game, if NetPlay is not running @@ -798,7 +804,8 @@ bool MainWindow::RequestStop() m_stop_requested ? tr("A shutdown is already in progress. Unsaved data " "may be lost if you stop the current emulation " "before it completes. Force stop?") : - tr("Do you want to stop the current emulation?")); + tr("Do you want to stop the current emulation?"), + QMessageBox::Yes | QMessageBox::No, QMessageBox::NoButton, Qt::ApplicationModal); if (confirm != QMessageBox::Yes) { -- cgit v1.2.3