diff --git a/src/core/host_interface.cpp b/src/core/host_interface.cpp index d5c6ee43b..cb55020b7 100644 --- a/src/core/host_interface.cpp +++ b/src/core/host_interface.cpp @@ -93,6 +93,7 @@ bool HostInterface::BootSystem(const SystemBootParameters& parameters) if (!AcquireHostDisplay()) { ReportFormattedError("Failed to acquire host display"); + OnSystemDestroyed(); return false; } diff --git a/src/duckstation-qt/mainwindow.cpp b/src/duckstation-qt/mainwindow.cpp index 5d44bb877..8a6d306a9 100644 --- a/src/duckstation-qt/mainwindow.cpp +++ b/src/duckstation-qt/mainwindow.cpp @@ -184,9 +184,17 @@ void MainWindow::focusDisplayWidget() m_display_widget->setFocus(); } -void MainWindow::onEmulationStarted() +void MainWindow::onEmulationStarting() { m_emulation_running = true; + updateEmulationActions(true, false); + + // ensure it gets updated, since the boot can take a while + QGuiApplication::processEvents(QEventLoop::ExcludeUserInputEvents); +} + +void MainWindow::onEmulationStarted() +{ updateEmulationActions(false, true); } @@ -503,7 +511,8 @@ void MainWindow::connectSignals() connect(m_ui.actionStartDisc, &QAction::triggered, this, &MainWindow::onStartDiscActionTriggered); connect(m_ui.actionStartBios, &QAction::triggered, this, &MainWindow::onStartBIOSActionTriggered); - connect(m_ui.actionResumeLastState, &QAction::triggered, m_host_interface, &QtHostInterface::resumeSystemFromMostRecentState); + connect(m_ui.actionResumeLastState, &QAction::triggered, m_host_interface, + &QtHostInterface::resumeSystemFromMostRecentState); connect(m_ui.actionChangeDisc, &QAction::triggered, [this] { m_ui.menuChangeDisc->exec(QCursor::pos()); }); connect(m_ui.actionChangeDiscFromFile, &QAction::triggered, this, &MainWindow::onChangeDiscFromFileActionTriggered); connect(m_ui.actionChangeDiscFromGameList, &QAction::triggered, this, @@ -555,6 +564,7 @@ void MainWindow::connectSignals() connect(m_host_interface, &QtHostInterface::updateDisplayRequested, this, &MainWindow::updateDisplay, Qt::BlockingQueuedConnection); connect(m_host_interface, &QtHostInterface::focusDisplayWidgetRequested, this, &MainWindow::focusDisplayWidget); + connect(m_host_interface, &QtHostInterface::emulationStarting, this, &MainWindow::onEmulationStarting); connect(m_host_interface, &QtHostInterface::emulationStarted, this, &MainWindow::onEmulationStarted); connect(m_host_interface, &QtHostInterface::emulationStopped, this, &MainWindow::onEmulationStopped); connect(m_host_interface, &QtHostInterface::emulationPaused, this, &MainWindow::onEmulationPaused); diff --git a/src/duckstation-qt/mainwindow.h b/src/duckstation-qt/mainwindow.h index 49a15c584..2a1f76bb3 100644 --- a/src/duckstation-qt/mainwindow.h +++ b/src/duckstation-qt/mainwindow.h @@ -33,6 +33,8 @@ private Q_SLOTS: void updateDisplay(QThread* worker_thread, bool fullscreen, bool render_to_main); void destroyDisplay(); void focusDisplayWidget(); + + void onEmulationStarting(); void onEmulationStarted(); void onEmulationStopped(); void onEmulationPaused(bool paused); diff --git a/src/duckstation-qt/qthostinterface.cpp b/src/duckstation-qt/qthostinterface.cpp index b8b2da063..4c7ca0d41 100644 --- a/src/duckstation-qt/qthostinterface.cpp +++ b/src/duckstation-qt/qthostinterface.cpp @@ -209,6 +209,7 @@ void QtHostInterface::bootSystem(const SystemBootParameters& params) return; } + emit emulationStarting(); BootSystem(params); } @@ -221,6 +222,7 @@ void QtHostInterface::resumeSystemFromState(const QString& filename, bool boot_o return; } + emit emulationStarting(); if (filename.isEmpty()) HostInterface::ResumeSystemFromMostRecentState(); else @@ -235,6 +237,7 @@ void QtHostInterface::resumeSystemFromMostRecentState() return; } + emit emulationStarting(); HostInterface::ResumeSystemFromMostRecentState(); } diff --git a/src/duckstation-qt/qthostinterface.h b/src/duckstation-qt/qthostinterface.h index edc38776e..9a68219f2 100644 --- a/src/duckstation-qt/qthostinterface.h +++ b/src/duckstation-qt/qthostinterface.h @@ -93,6 +93,7 @@ Q_SIGNALS: void errorReported(const QString& message); void messageReported(const QString& message); bool messageConfirmed(const QString& message); + void emulationStarting(); void emulationStarted(); void emulationStopped(); void emulationPaused(bool paused);