#include "homescreenhandler.h"
#include "hmi-debug.h"
+QScreen *find_screen(const char *output);
+
// defined by meson build file
#include QT_QPA_HEADER
mp_launcher = launcher;
mp_applauncher_client = new AppLauncherClient();
QPlatformNativeInterface *native = qApp->platformNativeInterface();
- m_output = getWlOutput(native, qApp->screens().first());
//
// The "started" event is received any time a start request is made to applaunchd,
void HomescreenHandler::activateApp(const QString& app_id)
{
struct agl_shell *agl_shell = aglShell->shell.get();
+ QPlatformNativeInterface *native = qApp->platformNativeInterface();
+ struct wl_output *mm_output = getWlOutput(native, qApp->screens().first());
if (mp_launcher) {
mp_launcher->setCurrent(app_id);
}
+ HMI_DEBUG("HomeScreen", "Activating app_id %s by default output %p\n",
+ app_id.toStdString().c_str(), mm_output);
+
+ // search for a pending application which might have a different output
+ auto iter = pending_app_list.begin();
+ bool found_pending_app = false;
+ while (iter != pending_app_list.end()) {
+ const QString &app_to_search = iter->first;
+
+ if (app_to_search == app_id) {
+ found_pending_app = true;
+ break;
+ }
+
+ iter++;
+ }
+
+ if (found_pending_app) {
+ const QString &output_name = iter->second;
+ QScreen *screen =
+ ::find_screen(output_name.toStdString().c_str());
+
+ mm_output = getWlOutput(native, screen);
+ pending_app_list.erase(iter);
+
+ HMI_DEBUG("HomeScreen", "For application %s found another "
+ "output to activate %s\n",
+ app_id.toStdString().c_str(),
+ output_name.toStdString().c_str());
+ }
+
+ HMI_DEBUG("HomeScreen", "Activating application %s",
+ app_id.toStdString().c_str());
- HMI_DEBUG("HomeScreen", "Activating application %s", app_id.toStdString().c_str());
- agl_shell_activate_app(agl_shell, app_id.toStdString().c_str(), m_output);
+ agl_shell_activate_app(agl_shell, app_id.toStdString().c_str(), mm_output);
}
void HomescreenHandler::deactivateApp(const QString& app_id)