feat: identify more applications

This commit is contained in:
kateleet 2021-12-23 11:51:21 +08:00
parent aa7762c176
commit 36fa1781ea

View file

@ -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;