From 74cdd242a4dbf2aac80942e8c936fca1e69141b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Thu, 8 Nov 2018 22:02:32 +0100 Subject: [PATCH] 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 --- client.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client.cpp b/client.cpp index 74fb528056..93dc022d18 100644 --- a/client.cpp +++ b/client.cpp @@ -45,7 +45,9 @@ along with this program. If not, see . // Qt #include #include +#include #include +#include #include #include // 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())