diff options
author | Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com> | 2022-06-06 19:57:49 +0300 |
---|---|---|
committer | Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com> | 2022-09-22 07:40:31 +0000 |
commit | 8479190d2356e376c574c5433de1f6d0c5ba04ff (patch) | |
tree | b90aeecdbc462c21e82409ff825191858ac45b1a | |
parent | c5115f91d0bf432b3dca32c652bd6fc330b6d7d5 (diff) |
Cluster application configurable to run on particular output.
Bug-AGL: SPEC-3818
Signed-off-by: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com>
Change-Id: If10020e4a5be7d3706215c39b8828b87c78d79e3
-rw-r--r-- | app/main.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/app/main.cpp b/app/main.cpp index 3d02a51..775f7f5 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -142,6 +142,18 @@ create_component(QPlatformNativeInterface *native, QQmlComponent *comp, return getWlSurface(native, win); } +static QScreen *find_screen(const char *screen_name) +{ + QList<QScreen *> screens = qApp->screens(); + QString name(screen_name); + + for (QScreen *screen : screens) { + if (name == screen->name()) + return screen; + } + + return nullptr; +} int main(int argc, char *argv[]) { @@ -163,7 +175,11 @@ int main(int argc, char *argv[]) std::shared_ptr<struct agl_shell> shell{agl_shell, agl_shell_destroy}; - screen = qApp->primaryScreen(); + const char *screen_name = getenv("DASHBOARD_START_SCREEN"); + if (screen_name) + screen = find_screen(screen_name); + else + screen = qApp->primaryScreen(); output = getWlOutput(native, screen); read_config(); |