diff --git a/Source/RMG/UserInterface/MainWindow.cpp b/Source/RMG/UserInterface/MainWindow.cpp index bdd06aef..bdd1cb7f 100644 --- a/Source/RMG/UserInterface/MainWindow.cpp +++ b/Source/RMG/UserInterface/MainWindow.cpp @@ -680,7 +680,7 @@ void MainWindow::launchEmulationThread(QString cartRom, QString address, int por this->launchEmulationThread(cartRom, "", false, -1, true); } -void MainWindow::launchEmulationThread(QString cartRom, QString diskRom, bool refreshRomListAfterEmulation, int slot, bool netplay) +void MainWindow::launchEmulationThread(QString cartRom, QString diskRom, bool refreshRomListAfterEmulation, int slot, bool netplay, bool dragdrop) { #ifdef NETPLAY if (this->netplaySessionDialog != nullptr && !netplay) @@ -690,7 +690,7 @@ void MainWindow::launchEmulationThread(QString cartRom, QString diskRom, bool re } #endif // NETPLAY - if (this->emulationThread->isRunning()) + if (!dragdrop && this->emulationThread->isRunning()) { this->showErrorMessage("EmulationThread::run Failed", "Cannot start emulation when emulation is already running or being started"); return; @@ -1435,6 +1435,13 @@ void MainWindow::on_EventFilter_FileDropped(QDropEvent *event) bool refreshRomList = false; QString file; + // when we're still opening the ROM while emulation is running, + // ignore the event + if (this->emulationThread->isRunning() && !CoreHasRomOpen()) + { + return; + } + if (inEmulation && confirmDragDrop) { QMessageBox::StandardButton reply = QMessageBox::question(this, "", @@ -1460,7 +1467,7 @@ void MainWindow::on_EventFilter_FileDropped(QDropEvent *event) refreshRomList = this->ui_RefreshRomListAfterEmulation; } - this->launchEmulationThread(file, "", refreshRomList); + this->launchEmulationThread(file, "", refreshRomList, -1, false, true); #endif // DRAG_DROP } diff --git a/Source/RMG/UserInterface/MainWindow.hpp b/Source/RMG/UserInterface/MainWindow.hpp index 79380a63..3c1a69f5 100644 --- a/Source/RMG/UserInterface/MainWindow.hpp +++ b/Source/RMG/UserInterface/MainWindow.hpp @@ -139,7 +139,7 @@ class MainWindow : public QMainWindow, private Ui::MainWindow void initializeEmulationThread(void); void connectEmulationThreadSignals(void); void launchEmulationThread(QString cartRom, QString address, int port, int player); - void launchEmulationThread(QString cartRom, QString diskRom = "", bool refreshRomListAfterEmulation = false, int slot = -1, bool netplay = false); + void launchEmulationThread(QString cartRom, QString diskRom = "", bool refreshRomListAfterEmulation = false, int slot = -1, bool netplay = false, bool dragdrop = false); QString getSaveStateSlotDateTimeText(QAction* action); QString getSaveStateSlotText(QAction* action, int slot);