Update protocol to other surface roles
[apps/launcher.git] / launcher / src / shell-desktop.cpp
index 42cc6d1..8b78f6f 100644 (file)
@@ -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)
 {
@@ -60,7 +85,8 @@ Shell::deactivate_app(const QString &app_id)
 
 void
 Shell::set_window_props(QWindow *win, const QString &app_id,
-                       uint32_t props, int x, int y)
+                       uint32_t props, int x, int y, int bx, int by,
+                       int bwidth, int bheight)
 {
        QScreen *screen = nullptr;
        struct wl_output *output;
@@ -78,5 +104,6 @@ Shell::set_window_props(QWindow *win, const QString &app_id,
        output = getWlOutput(screen);
        agl_shell_desktop_set_app_property(this->shell.get(),
                                           app_id.toStdString().c_str(),
-                                          props, x, y, output);
+                                          props, x, y, bx, by,
+                                          bwidth, bheight, output);
 }