diff options
author | Samuli Piippo <samuli.piippo@qt.io> | 2017-05-09 13:28:39 +0300 |
---|---|---|
committer | Samuli Piippo <samuli.piippo@qt.io> | 2017-05-17 08:39:01 +0000 |
commit | b9dd6a363e6eb6006ff5f923b6847b8046a245c2 (patch) | |
tree | a30e0cac80410cb0aabe9a6e9c5af1bd7e863c32 | |
parent | f4cd6b9667b4649b4ef8b4bb645850b05aceebde (diff) |
Create the cluster view directly to the second display
The 'screen' QML property was introduced in Qt 5.9 and enables
to create component directly to the correct screen, instead of
moving it afterwards. Needed to support multiple displays in
Intel NUC with KMS.
Other fixes included to work correctly with latest appman.
Task-number: AUTOSUITE-111
Change-Id: Ib0bb0b271a8ddfd01af795e7c94053bed0e6cc52
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
-rw-r--r-- | CenterConsole/plugins/screenManager/screenmanager.cpp | 8 | ||||
-rw-r--r-- | CenterConsole/plugins/screenManager/screenmanager.h | 4 | ||||
-rw-r--r-- | Main.qml | 4 | ||||
-rw-r--r-- | imports/shared/utils/Style.qml | 4 | ||||
-rw-r--r-- | kms_config.json | 1 | ||||
-rw-r--r-- | scripts/automotivedemo.service | 2 |
6 files changed, 13 insertions, 10 deletions
diff --git a/CenterConsole/plugins/screenManager/screenmanager.cpp b/CenterConsole/plugins/screenManager/screenmanager.cpp index 06bc4dc..c663567 100644 --- a/CenterConsole/plugins/screenManager/screenmanager.cpp +++ b/CenterConsole/plugins/screenManager/screenmanager.cpp @@ -49,9 +49,13 @@ void ScreenManager::setScreen(QWindow *window, int screen) } } -QList<QScreen *> ScreenManager::availableScreens() const +QList<QObject *> ScreenManager::availableScreens() const { - return QGuiApplication::screens(); + QList<QObject *> list; + for (QScreen *screen : QGuiApplication::screens()) + list.append(screen); + + return list; } int ScreenManager::screenCount() const diff --git a/CenterConsole/plugins/screenManager/screenmanager.h b/CenterConsole/plugins/screenManager/screenmanager.h index b12f860..9641b84 100644 --- a/CenterConsole/plugins/screenManager/screenmanager.h +++ b/CenterConsole/plugins/screenManager/screenmanager.h @@ -38,14 +38,14 @@ class ScreenManager : public QObject { Q_OBJECT - Q_PROPERTY(QList<QScreen*> availableScreens READ availableScreens NOTIFY availableScreensChanged) + Q_PROPERTY(QList<QObject*> availableScreens READ availableScreens NOTIFY availableScreensChanged) public: explicit ScreenManager(QObject *parent = 0); Q_INVOKABLE int screenCount() const; Q_INVOKABLE void setScreen(QWindow * window, int screen); - QList<QScreen*> availableScreens() const; + QList<QObject*> availableScreens() const; signals: void availableScreensChanged(); @@ -40,7 +40,7 @@ import QtQuick 2.1 -import QtQuick.Window 2.1 +import QtQuick.Window 2.3 import QtApplicationManager 1.0 import com.pelagicore.ScreenManager 1.0 import utils 1.0 @@ -99,6 +99,7 @@ Rectangle { height: 720 width: 1920 visible: false + screen: Qt.application.screens[1] color: "black" @@ -106,7 +107,6 @@ Rectangle { Component.onCompleted: { WindowManager.registerCompositorView(cluster) - ScreenManager.setScreen(cluster, 1) cluster.show() } } diff --git a/imports/shared/utils/Style.qml b/imports/shared/utils/Style.qml index cc6f4ec..9ef1b39 100644 --- a/imports/shared/utils/Style.qml +++ b/imports/shared/utils/Style.qml @@ -97,8 +97,8 @@ QtObject { property url fonts: Qt.resolvedUrl('../assets/fonts/') property bool isClient: typeof ApplicationInterface !== 'undefined' - property string styleConfig: isClient ? ApplicationInterface.additionalConfiguration.styleConfig : ApplicationManager.systemProperties.styleConfig - property bool showClusterIfPossible: isClient ? ApplicationInterface.additionalConfiguration.showCluster :ApplicationManager.systemProperties.showCluster + property string styleConfig: isClient ? ApplicationInterface.systemProperties.styleConfig : ApplicationManager.systemProperties.styleConfig + property bool showClusterIfPossible: isClient ? ApplicationInterface.systemProperties.showCluster :ApplicationManager.systemProperties.showCluster property Loader styleLoader: Loader { property bool showClusterIfPossible: root.showClusterIfPossible diff --git a/kms_config.json b/kms_config.json index 232a7a2..d108380 100644 --- a/kms_config.json +++ b/kms_config.json @@ -1,5 +1,4 @@ { - "device": "drm-nvdc", "separateScreens": true, "outputs": [ { diff --git a/scripts/automotivedemo.service b/scripts/automotivedemo.service index 2e73b1d..ed665d4 100644 --- a/scripts/automotivedemo.service +++ b/scripts/automotivedemo.service @@ -1,6 +1,6 @@ [Unit] Description=AutomotiveDemo -After=systemd-user-sessions.service +After=systemd-user-sessions.service dbus-session.service [Service] ExecStart=/opt/automotivedemo/start.sh |