The switch to the new compositor removed the callback to update the
top panel button highlight since it was being driven by the
Event_ScreenUpdated event from the old windowmanager. For now, work
around this by driving the ApplicationLauncher's setCurrent method
from the appropriate place in the HomescreenHandler object's
tapShortcut method. If a generic mechanism for notifications on
application expose becomes available via agl-shell-desktop, that
should be used instead.
Additionally, add an explicit call to setCurrent on initialization to
highlight the top panel Launcher button, matching the actual initial
UI state.
Bug-AGL: SPEC-3510
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: Ied5dd8e78195d061585510e60a758559ca4f69b3
void* HomescreenHandler::myThis = 0;
void* HomescreenHandler::myThis = 0;
-HomescreenHandler::HomescreenHandler(Shell *_aglShell, QObject *parent) :
+HomescreenHandler::HomescreenHandler(Shell *_aglShell, ApplicationLauncher *launcher, QObject *parent) :
QObject(parent),
aglShell(_aglShell)
{
QObject(parent),
aglShell(_aglShell)
{
+ mp_launcher = launcher;
}
HomescreenHandler::~HomescreenHandler()
}
HomescreenHandler::~HomescreenHandler()
// the first time. Later calls to HomescreenHandler::tapShortcut will
// require calling 'agl_shell_activate_app'
agl_shell_activate_app(agl_shell, application_id.toStdString().c_str(), output);
// the first time. Later calls to HomescreenHandler::tapShortcut will
// require calling 'agl_shell_activate_app'
agl_shell_activate_app(agl_shell, application_id.toStdString().c_str(), output);
+
+ if (mp_launcher) {
+ mp_launcher->setCurrent(application_id);
+ }
}
void HomescreenHandler::onRep_static(struct json_object* reply_contents)
}
void HomescreenHandler::onRep_static(struct json_object* reply_contents)
#include <QObject>
#include <libhomescreen.hpp>
#include <QObject>
#include <libhomescreen.hpp>
+#include "applicationlauncher.h"
#include "shell.h"
#include <string>
#include "shell.h"
#include <string>
- explicit HomescreenHandler(Shell *aglShell, QObject *parent = 0);
+ explicit HomescreenHandler(Shell *aglShell, ApplicationLauncher *launcher = 0, QObject *parent = 0);
~HomescreenHandler();
void init(int port, const char* token);
~HomescreenHandler();
void init(int port, const char* token);
void showInformation(QString info);
private:
LibHomeScreen *mp_hs;
void showInformation(QString info);
private:
LibHomeScreen *mp_hs;
+ ApplicationLauncher *mp_launcher;
Shell *aglShell = new Shell(shell, &a);
// import C++ class to QML
Shell *aglShell = new Shell(shell, &a);
// import C++ class to QML
- // qmlRegisterType<ApplicationLauncher>("HomeScreen", 1, 0, "ApplicationLauncher");
qmlRegisterType<StatusBarModel>("HomeScreen", 1, 0, "StatusBarModel");
qmlRegisterType<MasterVolume>("MasterVolume", 1, 0, "MasterVolume");
qmlRegisterUncreatableType<ChromeController>("SpeechChrome", 1, 0, "SpeechChromeController",
QLatin1String("SpeechChromeController is uncreatable."));
ApplicationLauncher *launcher = new ApplicationLauncher();
qmlRegisterType<StatusBarModel>("HomeScreen", 1, 0, "StatusBarModel");
qmlRegisterType<MasterVolume>("MasterVolume", 1, 0, "MasterVolume");
qmlRegisterUncreatableType<ChromeController>("SpeechChrome", 1, 0, "SpeechChromeController",
QLatin1String("SpeechChromeController is uncreatable."));
ApplicationLauncher *launcher = new ApplicationLauncher();
-
- HomescreenHandler* homescreenHandler = new HomescreenHandler(aglShell);
+ launcher->setCurrent(QStringLiteral("launcher"));
+ HomescreenHandler* homescreenHandler = new HomescreenHandler(aglShell, launcher);
homescreenHandler->init(port, token.toStdString().c_str());
QUrl bindingAddress;
homescreenHandler->init(port, token.toStdString().c_str());
QUrl bindingAddress;