summaryrefslogtreecommitdiff
path: root/examples/wayland
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2023-02-08 12:06:36 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2023-02-10 11:26:43 +0100
commitc5a253cc87c75640d828407cc85832d9be28cbbc (patch)
treed064b6fa56310efc6bbfc729c788e012e520e429 /examples/wayland
parentc492d61165f83cf1cbade21f4483131f979f3e04 (diff)
downloadqtwayland-c5a253cc87c75640d828407cc85832d9be28cbbc.tar.gz
compositor: Fix QML errors in multi-screen example
The output property was not hooked up to the surface item, causing the error "qrc:/qml/main.qml: Setting initial properties failed: Chrome does not have a property called output" In addition, when emulating screens, the model is a ListModel, and thus there is no modelData to access (nor would it make any sense to assign this to the screen property). We just set the screen to be the (only) screen on the system in this case. Pick-to: 6.5 Task-number: QTBUG-110993 Change-Id: I7f6ec15dd038605bd0d94a34600ecbf22aad9878 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'examples/wayland')
-rw-r--r--examples/wayland/multi-screen/qml/Chrome.qml1
-rw-r--r--examples/wayland/multi-screen/qml/main.qml2
2 files changed, 2 insertions, 1 deletions
diff --git a/examples/wayland/multi-screen/qml/Chrome.qml b/examples/wayland/multi-screen/qml/Chrome.qml
index 33e14787..d3485e81 100644
--- a/examples/wayland/multi-screen/qml/Chrome.qml
+++ b/examples/wayland/multi-screen/qml/Chrome.qml
@@ -10,6 +10,7 @@ Item {
property alias shellSurface: surfaceItem.shellSurface
property alias surfaceItem: surfaceItem
property alias moveItem: surfaceItem.moveItem
+ property alias output: surfaceItem.output
//! [position sync]
x: surfaceItem.moveItem.x - surfaceItem.output.geometry.x
diff --git a/examples/wayland/multi-screen/qml/main.qml b/examples/wayland/multi-screen/qml/main.qml
index fc14d0a7..1180d30b 100644
--- a/examples/wayland/multi-screen/qml/main.qml
+++ b/examples/wayland/multi-screen/qml/main.qml
@@ -30,7 +30,7 @@ WaylandCompositor {
surfaceArea.color: "lightsteelblue"
text: name
compositor: comp
- screen: modelData
+ screen: emulated ? Qt.application.screens[0] : modelData
Component.onCompleted: if (!comp.defaultOutput) comp.defaultOutput = this
position: Qt.point(virtualX, virtualY)
windowed: emulated