homescreen: Bail out if no screens are found
[apps/homescreen.git] / homescreen / src / main.cpp
index 4e3073f..e9a5817 100644 (file)
@@ -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);
@@ -248,6 +253,7 @@ load_agl_shell_app(QPlatformNativeInterface *native,
 int main(int argc, char *argv[])
 {
     setenv("QT_QPA_PLATFORM", "wayland", 1);
+    setenv("QT_QUICK_CONTROLS_STYLE", "AGL", 1);
     QGuiApplication a(argc, argv);
     const char *screen_name;
     bool is_demo_val = false;