From 82bfc3a25532c9de903613d3eb71f8453fd01682 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Fri, 29 May 2020 13:30:15 +0300 Subject: homescreenhandler: Add the ability to specify the output based on the screen Pass the output when activing the surface in Launcher.qml Signed-off-by: Marius Vlad --- launcher/src/shell-desktop.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'launcher/src/shell-desktop.cpp') diff --git a/launcher/src/shell-desktop.cpp b/launcher/src/shell-desktop.cpp index 42cc6d1..b8e6ef0 100644 --- a/launcher/src/shell-desktop.cpp +++ b/launcher/src/shell-desktop.cpp @@ -51,6 +51,31 @@ Shell::activate_app(QWindow *win, const QString &app_id, 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) { -- cgit 1.2.3-korg