property string currentId: ''
property int newIndex: -1
property int index: grid.indexAt(loc.mouseX, loc.mouseY)
+ property string output_screen: ''
x: 62
y: 264
onPressAndHold: currentId = applicationModel.id(newIndex = index)
if(loc.index < 0) {
return
}
+
+ //if (applicationModel.appid(loc.index) === 'tbtnavi' ||
+ // applicationModel.appid(loc.index) === 'hvac') {
+ // output_screen = 'Virtual-1'
+ //}
if (currentId === '') {
- homescreenHandler.tapShortcut(applicationModel.appid(loc.index))
+ homescreenHandler.tapShortcut(applicationModel.appid(loc.index), output_screen)
} else {
currentId = ''
}
});
}
-void HomescreenHandler::tapShortcut(QString application_id)
+void HomescreenHandler::tapShortcut(QString application_id, QString output_name)
{
HMI_DEBUG("Launcher","tapShortcut %s", application_id.toStdString().c_str());
struct json_object* j_json = json_object_new_object();
json_object_object_add(j_json, "area", value);
mp_hs->showWindow(application_id.toStdString().c_str(), j_json);
- aglShell->activate_app(nullptr, application_id, nullptr);
+ if (output_name.isEmpty())
+ aglShell->activate_app(nullptr, application_id, nullptr);
+ else
+ aglShell->activate_app_by_screen(output_name, application_id, nullptr);
}
void HomescreenHandler::onRep_static(struct json_object* reply_contents)
void init(int port, const char* token, QString myname);
- Q_INVOKABLE void tapShortcut(QString application_id);
+ Q_INVOKABLE void tapShortcut(QString application_id, QString output_name);
Q_INVOKABLE void getRunnables(void);
void onRep(struct json_object* reply_contents);
app_data.toStdString().c_str(), output);
}
+void
+Shell::activate_app_by_screen(const QString &screen_name, const QString &app_id,
+ const QString &app_data)
+{
+ QScreen *qscreen_to_put = nullptr;
+ for (auto &ss: qApp->screens()) {
+ if (ss->name() == screen_name) {
+ qscreen_to_put = ss;
+ break;
+ }
+ }
+
+ /* use the primary one */
+ if (!qscreen_to_put) {
+ qscreen_to_put = qApp->screens().first();
+ }
+
+ struct wl_output *output = getWlOutput(qscreen_to_put);
+ qDebug() << "will activate app: " << app_id << " on output " <<
+ qscreen_to_put->name();
+ agl_shell_desktop_activate_app(this->shell.get(),
+ app_id.toStdString().c_str(),
+ app_data.toStdString().c_str(), output);
+}
+
void
Shell::deactivate_app(const QString &app_id)
{
public slots: // calls out of qml into CPP
void activate_app(QWindow *win, const QString &app_id, const QString &app_data);
+ void activate_app_by_screen(const QString &screen_name,
+ const QString &app_id,
+ const QString &app_data);
void deactivate_app(const QString &app_id);
void set_window_props(QWindow *win, const QString &app_id,
uint32_t props, int x, int y);