diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index e60af1faa8b..efc1680458e 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -292,12 +292,6 @@ public: } } - void raiseApplication() - { - QTC_ASSERT(runControl(), return); - runControl()->bringApplicationToForeground(); - } - void scheduleResetLocation() { m_stackHandler.scheduleResetLocation(); @@ -1323,7 +1317,7 @@ void DebuggerEngine::notifyInferiorPid(const ProcessHandle &pid) showMessage(tr("Taking notice of pid %1").arg(pid.pid())); DebuggerStartMode sm = runParameters().startMode; if (sm == StartInternal || sm == StartExternal || sm == AttachExternal) - QTimer::singleShot(0, d, &DebuggerEnginePrivate::raiseApplication); + d->m_inferiorPid.activate(); } } diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 0a0ed1d5166..10e6d4f3b21 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -377,7 +377,7 @@ void QmlEngine::handleLauncherStarted() { // FIXME: The QmlEngine never calls notifyInferiorPid() triggering the // raising, so do it here manually for now. - runControl()->bringApplicationToForeground(); + runControl()->applicationProcessHandle().activate(); d->noDebugOutputTimer.start(); } diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 345cbcd5cc3..566ecc69129 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -1348,18 +1348,6 @@ void RunControlPrivate::debugMessage(const QString &msg) qCDebug(statesLog()) << msg; } -/*! - Brings the application determined by this RunControl's \c applicationProcessHandle - to the foreground. - - The default implementation raises the application on Mac, and does - nothing elsewhere. -*/ -void RunControl::bringApplicationToForeground() -{ - d->applicationProcessHandle.activate(); -} - void RunControl::appendMessage(const QString &msg, Utils::OutputFormat format) { emit appendMessageRequested(this, msg, format); @@ -1478,8 +1466,9 @@ void SimpleTargetRunner::stop() void SimpleTargetRunner::onProcessStarted() { // Console processes only know their pid after being started - runControl()->setApplicationProcessHandle(m_launcher.applicationPID()); - runControl()->bringApplicationToForeground(); + ProcessHandle pid = m_launcher.applicationPID(); + runControl()->setApplicationProcessHandle(pid); + pid.activate(); reportStarted(); } diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 0b9b3618def..4d49d434ea4 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -435,7 +435,6 @@ public: void setRunnable(const Runnable &runnable); virtual void appendMessage(const QString &msg, Utils::OutputFormat format); - virtual void bringApplicationToForeground(); static bool showPromptToStopDialog(const QString &title, const QString &text, const QString &stopButtonText = QString(),