Commit 3f4c5a22 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

xdgactivation: Make sure we don't call setStartupId with an x11 token

Besides not working on Wayland, it will prevent the job from fetching a
working token.


(cherry picked from commit aa385fb0)
parent a3b80716
Pipeline #169975 passed with stage
in 10 minutes and 26 seconds
......@@ -32,6 +32,7 @@
#include <KShell>
#include <KStartupInfo>
#include <KSycoca>
#include <KWindowSystem>
#include <Plasma/Plasma>
......@@ -209,7 +210,9 @@ bool AppEntry::run(const QString &actionId, const QVariant &argument)
auto *job = new KIO::ApplicationLauncherJob(m_service);
job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled));
job->setRunFlags(KIO::ApplicationLauncherJob::DeleteTemporaryFiles);
job->setStartupId(KStartupInfo::createNewStartupIdForTimestamp(timeStamp));
if (KWindowSystem::isPlatformX11()) {
job->setStartupId(KStartupInfo::createNewStartupIdForTimestamp(timeStamp));
}
job->start();
KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("applications:") + m_service->storageId()), QStringLiteral("org.kde.plasma.kicker"));
......
......@@ -37,6 +37,7 @@
#include <KActivities/Stats/Cleaning>
#include <KActivities/Stats/ResultModel>
#include <KActivities/Stats/Terms>
#include <KWindowSystem>
namespace KAStats = KActivities::Stats;
......@@ -391,7 +392,9 @@ bool RecentUsageModel::trigger(int row, const QString &actionId, const QVariant
auto *job = new KIO::ApplicationLauncherJob(service);
job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled));
job->setStartupId(KStartupInfo::createNewStartupIdForTimestamp(timeStamp));
if (KWindowSystem::isPlatformX11()) {
job->setStartupId(KStartupInfo::createNewStartupIdForTimestamp(timeStamp));
}
job->start();
KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("applications:") + storageId), QStringLiteral("org.kde.plasma.kicker"));
......
......@@ -546,7 +546,9 @@ void LauncherTasksModel::requestOpenUrls(const QModelIndex &index, const QList<Q
auto *job = new KIO::ApplicationLauncherJob(service);
job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoErrorHandlingEnabled));
job->setUrls(urls);
job->setStartupId(KStartupInfo::createNewStartupIdForTimestamp(timeStamp));
if (KWindowSystem::isPlatformX11()) {
job->setStartupId(KStartupInfo::createNewStartupIdForTimestamp(timeStamp));
}
job->start();
KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("applications:") + service->storageId()), QStringLiteral("org.kde.libtaskmanager"));
......
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