From 36fa1781eace058b599f1115ff74ee8a8d55defc Mon Sep 17 00:00:00 2001 From: kateleet Date: Thu, 23 Dec 2021 11:51:21 +0800 Subject: [PATCH] feat: identify more applications --- src/utils.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils.cpp b/src/utils.cpp index f225b48..1b7e2cf 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -106,6 +106,7 @@ QString Utils::desktopPathFromMetadata(const QString &appId, quint32 pid, const // Start search. const QFileInfo desktopFileInfo(item->path); + bool isExecPath = QFile::exists(item->exec); bool founded = false; if (item->exec == command || item->exec == commandName) { @@ -142,6 +143,11 @@ QString Utils::desktopPathFromMetadata(const QString &appId, quint32 pid, const if (!founded && desktopFileInfo.baseName().startsWith(xWindowWMClassName, Qt::CaseInsensitive)) founded = true; + // For exec path. + if (isExecPath && !founded && (command.contains(item->exec) || commandName.contains(item->exec))) { + founded = true; + } + if (founded) { result = item->path; break;