diff --git a/src/main.cpp b/src/main.cpp index 3803e4ce2..79950e74c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -197,6 +197,8 @@ int main(int argc, char *argv[]) { qDebug("Passing program parameters to running instance..."); qDebug("Message: %s", qPrintable(message)); app.sendMessage(message); + } else { // Raise main window + app.sendMessage("qbt://show"); } return 0; } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 43a5383c0..dec5e3ca2 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -960,6 +960,14 @@ void MainWindow::processParams(const QStringList& params) { if (misc::isUrl(param)) { QBtSession::instance()->downloadFromUrl(param); }else{ + if(param.startsWith("qbt://show", Qt::CaseInsensitive)) { + if(!ui_locked) { + show(); + activateWindow(); + raise(); + } + return; // Do not process more params + } if (param.startsWith("bc://bt/", Qt::CaseInsensitive)) { qDebug("Converting bc link to magnet link"); param = misc::bcLinkToMagnet(param);