summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2022-01-17 13:46:38 +0200
committerMarius Vlad <marius.vlad@collabora.com>2022-01-18 20:37:38 +0200
commit37ba3ff90d878a135e347508505657e3d56c5edd (patch)
tree7d54980b0f15b0690cbc71aa91f419024891f70e
parent37d45e3c6fc294e8ee675e95ad7bde0d3b38327a (diff)
homescreenhandler: Do not attempt to start launcher
Our launcher application is started by systemd as a user session, and attempting to start it again would result into being started once more, but this by applaunchd. Until we merge homescreen and launcher together avoid starting it and just activate it whenever necessary. Bug-AGL: SPEC-4215 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I90806457b74a2439cb8bdc88068954eb7ef1d532
-rw-r--r--homescreen/src/homescreenhandler.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/homescreen/src/homescreenhandler.cpp b/homescreen/src/homescreenhandler.cpp
index 9111ebb..4a8b9cd 100644
--- a/homescreen/src/homescreenhandler.cpp
+++ b/homescreen/src/homescreenhandler.cpp
@@ -24,6 +24,9 @@
#define APPLAUNCH_DBUS_IFACE "org.automotivelinux.AppLaunch"
#define APPLAUNCH_DBUS_OBJECT "/org/automotivelinux/AppLaunch"
+/* LAUNCHER_APP_ID shouldn't be started by applaunchd as it is started as a
+ * user session by systemd */
+#define LAUNCHER_APP_ID "launcher"
void* HomescreenHandler::myThis = 0;
@@ -63,20 +66,27 @@ getWlOutput(QPlatformNativeInterface *native, QScreen *screen)
void HomescreenHandler::tapShortcut(QString application_id)
{
+ QDBusPendingReply<> reply;
HMI_DEBUG("HomeScreen","tapShortcut %s", application_id.toStdString().c_str());
- QDBusPendingReply<> reply = applaunch_iface->start(application_id);
+ if (application_id == LAUNCHER_APP_ID)
+ goto activate_app;
+
+ reply = applaunch_iface->start(application_id);
reply.waitForFinished();
+
if (reply.isError()) {
HMI_ERROR("HomeScreen","Unable to start application '%s': %s",
application_id.toStdString().c_str(),
reply.error().message().toStdString().c_str());
- } else {
- if (mp_launcher) {
- mp_launcher->setCurrent(application_id);
- }
- appStarted(application_id);
+ return;
+ }
+
+activate_app:
+ if (mp_launcher) {
+ mp_launcher->setCurrent(application_id);
}
+ appStarted(application_id);
}
void HomescreenHandler::appStarted(const QString& application_id)