Commit 74cdd242 authored by Martin Flöser's avatar Martin Flöser

Support starting the killer_helper from build dir

Summary:
As with all libexec executables we first need to test whether the binary
is available in the application's directory and start this, otherwise
the system wide installed one.

See: https://community.kde.org/Guidelines_and_HOWTOs/Making_apps_run_uninstalled

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16763
parent 97beb72d
......@@ -45,7 +45,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Qt
#include <QApplication>
#include <QDebug>
#include <QDir>
#include <QFile>
#include <QFileInfo>
#include <QMouseEvent>
#include <QProcess>
// XLib
......@@ -1186,7 +1188,9 @@ void Client::killProcess(bool ask, xcb_timestamp_t timestamp)
::kill(pid, SIGTERM);
} else {
QString hostname = clientMachine()->isLocal() ? QStringLiteral("localhost") : QString::fromUtf8(clientMachine()->hostName());
QProcess::startDetached(QStringLiteral(KWIN_KILLER_BIN),
// execute helper from build dir or the system installed one
const QFileInfo buildDirBinary{QDir{QCoreApplication::applicationDirPath()}, QStringLiteral("kwin_killer_helper")};
QProcess::startDetached(buildDirBinary.exists() ? buildDirBinary.absoluteFilePath() : QStringLiteral(KWIN_KILLER_BIN),
QStringList() << QStringLiteral("--pid") << QString::number(unsigned(pid)) << QStringLiteral("--hostname") << hostname
<< QStringLiteral("--windowname") << captionNormal()
<< QStringLiteral("--applicationname") << QString::fromUtf8(resourceClass())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment