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 aa385fb08f)
wilder-5.24
Aleix Pol 4 years ago committed by Aleix Pol Gonzalez
parent a3b8071623
commit 3f4c5a2236
  1. 5
      applets/kicker/plugin/appentry.cpp
  2. 5
      applets/kicker/plugin/recentusagemodel.cpp
  3. 4
      libtaskmanager/launchertasksmodel.cpp

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

Loading…
Cancel
Save