diff --git a/Source/Core/DolphinQt2/MainWindow.cpp b/Source/Core/DolphinQt2/MainWindow.cpp index c678d61bdf..7b6919d56c 100644 --- a/Source/Core/DolphinQt2/MainWindow.cpp +++ b/Source/Core/DolphinQt2/MainWindow.cpp @@ -52,6 +52,7 @@ MainWindow::MainWindow() : QMainWindow(nullptr) ConnectMenuBar(); InitControllers(); + InitCoreCallbacks(); } MainWindow::~MainWindow() @@ -88,6 +89,11 @@ void MainWindow::ShutdownControllers() m_hotkey_scheduler->deleteLater(); } +void MainWindow::InitCoreCallbacks() +{ + Core::SetOnStoppedCallback([this] { emit EmulationStopped(); }); +} + static void InstallHotkeyFilter(QWidget* dialog) { auto* filter = new WindowActivationEventFilter(); @@ -291,7 +297,6 @@ void MainWindow::ForceStop() { BootManager::Stop(); HideRenderWidget(); - emit EmulationStopped(); } void MainWindow::Reset() diff --git a/Source/Core/DolphinQt2/MainWindow.h b/Source/Core/DolphinQt2/MainWindow.h index 2b9b2c4e90..7577be2be7 100644 --- a/Source/Core/DolphinQt2/MainWindow.h +++ b/Source/Core/DolphinQt2/MainWindow.h @@ -69,6 +69,8 @@ private: void InitControllers(); void ShutdownControllers(); + void InitCoreCallbacks(); + void StartGame(const QString& path); void ShowRenderWidget(); void HideRenderWidget();