Commit 22f59e0a authored by John Zimmermann's avatar John Zimmermann Committed by Vlad Zahorodnii
Browse files

utils/serviceutils: compare executablePath against canonical path of exec fields in .desktops

/proc/%/exec always points to the canonical/real path of a binary,
the exec field of a .desktop might contain a symlink and therefore
differ from canonical path.
Explicitely canonicalizing the path in exec prevents this mismatch.


(cherry picked from commit 9c65d61b)
parent d4068754
Pipeline #137289 passed with stage
in 25 minutes and 7 seconds
......@@ -32,7 +32,7 @@ static QStringList fetchProcessServiceField(const QString &executablePath, const
static QLoggingCategory KWIN_UTILS ("KWIN_UTILS", QtWarningMsg);
const auto servicesFound = KApplicationTrader::query([&executablePath] (const KService::Ptr &service) {
if (service->exec().isEmpty() || service->exec() != executablePath)
if (service->exec().isEmpty() || QFileInfo(service->exec()).canonicalFilePath() != executablePath)
return false;
return true;
......
Supports Markdown
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