Manager: Implement double-clicking a VM entry to start a VM

(and on Windows, bringing it to front if already running)
This commit is contained in:
Alexander Babikov
2025-07-28 20:22:12 +05:00
parent b5ced14d1b
commit 494a24a3ae
2 changed files with 11 additions and 0 deletions

View File

@@ -123,6 +123,8 @@ VMManagerMain::VMManagerMain(QWidget *parent) :
ui->listView->setCurrentIndex(first_index);
}
connect(ui->listView, &QListView::doubleClicked, this, &VMManagerMain::startButtonPressed);
// Load and apply settings
loadSettings();

View File

@@ -408,6 +408,15 @@ VMManagerSystem::launchMainProcess() {
return;
}
}
// If the system is already running, bring it to front
if (process->processId() != 0) {
#ifdef Q_OS_WINDOWS
if (this->id) {
SetForegroundWindow((HWND)this->id);
}
#endif
return;
}
setProcessEnvVars();
QString program = main_binary.filePath();
QStringList args;