diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2020-05-29 13:30:15 +0300 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2020-06-24 17:05:32 +0300 |
commit | fc41fa6da7f64262a7bbc4313b920762e1a31d15 (patch) | |
tree | 377e945d5398863e4eb262b80a5e0d83da4dc4c4 /launcher/src/shell-desktop.cpp | |
parent | 259c66b9ebde64e857f36d8d1d7050bec2e8f41d (diff) |
homescreenhandler: Add the ability to specify the output based on the
screen
Pass the output when activing the surface in Launcher.qml
Bug-AGL: SPEC-3447
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I4b8f03c90712290f580a570cd2644a4bc44687c5
Diffstat (limited to 'launcher/src/shell-desktop.cpp')
-rw-r--r-- | launcher/src/shell-desktop.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
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 @@ -52,6 +52,31 @@ Shell::activate_app(QWindow *win, const QString &app_id, } 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) { agl_shell_desktop_deactivate_app(this->shell.get(), |