X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=homescreen%2Fsrc%2Fhomescreenhandler.cpp;h=2858ef4a6c910c74ee012545e66c6a89a268be06;hb=refs%2Fchanges%2F45%2F28045%2F2;hp=16d65fb2334ad714e04f4f50da888c8cd497fe60;hpb=20f629dd6d8628611d950073c4f7a0446c40365a;p=apps%2Fhomescreen.git diff --git a/homescreen/src/homescreenhandler.cpp b/homescreen/src/homescreenhandler.cpp index 16d65fb..2858ef4 100644 --- a/homescreen/src/homescreenhandler.cpp +++ b/homescreen/src/homescreenhandler.cpp @@ -11,7 +11,8 @@ #include "homescreenhandler.h" #include "hmi-debug.h" -#include +// defined by meson build file +#include QT_QPA_HEADER // LAUNCHER_APP_ID shouldn't be started by applaunchd as it is started as // a user session by systemd @@ -51,20 +52,16 @@ void HomescreenHandler::tapShortcut(QString app_id) { HMI_DEBUG("HomeScreen","tapShortcut %s", app_id.toStdString().c_str()); - if (app_id == LAUNCHER_APP_ID) - goto activate_app; + if (app_id == LAUNCHER_APP_ID) { + activateApp(app_id); + return; + } if (!mp_applauncher_client->startApplication(app_id)) { HMI_ERROR("HomeScreen","Unable to start application '%s'", app_id.toStdString().c_str()); return; } - -activate_app: - if (mp_launcher) { - mp_launcher->setCurrent(app_id); - } - activateApp(app_id); } /* @@ -90,13 +87,16 @@ void HomescreenHandler::addAppToStack(const QString& app_id) void HomescreenHandler::activateApp(const QString& app_id) { - struct agl_shell *agl_shell = aglShell->shell.get(); - QPlatformNativeInterface *native = qApp->platformNativeInterface(); - struct wl_output *output = getWlOutput(native, qApp->screens().first()); + struct agl_shell *agl_shell = aglShell->shell.get(); + QPlatformNativeInterface *native = qApp->platformNativeInterface(); + struct wl_output *output = getWlOutput(native, qApp->screens().first()); + + if (mp_launcher) { + mp_launcher->setCurrent(app_id); + } - HMI_DEBUG("HomeScreen", "Activating application %s", app_id.toStdString().c_str()); - agl_shell_activate_app(agl_shell, app_id.toStdString().c_str(), output); - addAppToStack(app_id); + HMI_DEBUG("HomeScreen", "Activating application %s", app_id.toStdString().c_str()); + agl_shell_activate_app(agl_shell, app_id.toStdString().c_str(), output); } void HomescreenHandler::deactivateApp(const QString& app_id) @@ -110,6 +110,9 @@ void HomescreenHandler::deactivateApp(const QString& app_id) void HomescreenHandler::processAppStatusEvent(const QString &app_id, const QString &status) { + HMI_DEBUG("HomeScreen", "Processing application %s, status %s", + app_id.toStdString().c_str(), status.toStdString().c_str()); + if (status == "started") { activateApp(app_id); } else if (status == "terminated") {