diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2022-07-07 13:00:19 +0300 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2022-07-08 16:45:52 +0300 |
commit | d1347bf236f84908fea96ba929e0e8376c2b1d78 (patch) | |
tree | 5f3026489c46803e35f8b0a023875513083c265d | |
parent | e490ff1e1e31b4a837cb8063f7346dc65ffe073e (diff) |
homescreen: Bail out if no screens are foundneedlefish_13.93.0needlefish/13.93.013.93.0
It might happen the system doesn't have any outputs connected, or there
are literally no outputs present in the system. Instead of crashing and
systemd trying always to start it up just make sure we handle that and
print out a message about what is going it.
Bug-AGL: SPEC-4459
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ia3dfab66e69ea36b2cf50fc0f6c1fd188a87e240
-rw-r--r-- | homescreen/src/main.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/homescreen/src/main.cpp b/homescreen/src/main.cpp index 74ec4f4..e9a5817 100644 --- a/homescreen/src/main.cpp +++ b/homescreen/src/main.cpp @@ -221,6 +221,11 @@ load_agl_shell_app(QPlatformNativeInterface *native, else screen = find_screen(screen_name); + if (!screen) { + qDebug() << "No outputs present in the system."; + return; + } + qDebug() << "found primary screen " << qApp->primaryScreen()->name() << "first screen " << qApp->screens().first()->name(); output = getWlOutput(native, screen); |