From aa5486abf0bf82b53b2d3d0eb016051e1db91dcf Mon Sep 17 00:00:00 2001 From: David Redondo Date: Mon, 8 Feb 2021 11:41:04 +0100 Subject: [PATCH] ksmserver: Filter out services with NoDisplay=true Solves a case where an application installs multiple desktop files for handling different mime types. Typically those have NoDisplay=true as recommended by the spec. But we want to associate the application with the "main" desktop file. An example of this happening within KDE is KDevelop. --- ksmserver/server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp index c5ba6c103..666c6f91b 100644 --- a/ksmserver/server.cpp +++ b/ksmserver/server.cpp @@ -135,7 +135,7 @@ void KSMServer::startApplication(const QStringList &cmd, const QString &clientMa auto *job = new KIO::CommandLauncherJob(app, argList); auto apps = KApplicationTrader::query([&app](const KService::Ptr service) { const QString binary = KIO::DesktopExecParser::executablePath(service->exec()); - return !binary.isEmpty() && app.endsWith(binary); + return !service->noDisplay() && !binary.isEmpty() && app.endsWith(binary); }); if (!apps.empty()) { job->setDesktopName(apps[0]->desktopEntryName());