summaryrefslogtreecommitdiffstats
path: root/examples/wayland/pure-qml/qml/main.qml
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@theqtcompany.com>2015-09-04 14:35:19 +0200
committerJørgen Lind <jorgen.lind@theqtcompany.com>2015-09-04 16:12:47 +0200
commit6358b0ede93c6633802126bf8bf0a44860e66917 (patch)
tree17c8a90565b3aa4f0d3c0cb36a642c0da53bf229 /examples/wayland/pure-qml/qml/main.qml
parentb666aa58d7a168fe4ddb694caba099343421aa65 (diff)
Make it possible to connect to a createSurface signal
Remove the QWaylandSurface factory function from QWaylandCompositor. Add a default constructor to QWaylandSurface and a initialize function. Add som housekeeping code in debug builds that ensures the user calls initialize. Add a fallback factory function on the compositor if the user is fine with getting the default implementation of QWaylandSurface or QWaylandQuickSurface Change-Id: Ib9289c323b6723f0d1119a484cf9e0c26c95b549
Diffstat (limited to 'examples/wayland/pure-qml/qml/main.qml')
-rw-r--r--examples/wayland/pure-qml/qml/main.qml13
1 files changed, 13 insertions, 0 deletions
diff --git a/examples/wayland/pure-qml/qml/main.qml b/examples/wayland/pure-qml/qml/main.qml
index 0fe92668a..12f6063b4 100644
--- a/examples/wayland/pure-qml/qml/main.qml
+++ b/examples/wayland/pure-qml/qml/main.qml
@@ -56,6 +56,13 @@ WaylandCompositor {
Chrome { }
}
+ Component {
+ id: surfaceComponent
+ WaylandSurface {
+ property QtObject shellSurface: null
+ }
+ }
+
extensions: [
DefaultShell {
id: defaultShell
@@ -69,6 +76,7 @@ WaylandCompositor {
var item = chromeComponent.createObject(defaultOutput.surfaceArea, { "surface": surface } );
var shellSurface = shellSurfaceComponent.createObject();
shellSurface.initialize(defaultShell, surface, item.view, client, id);
+ surface.shellSurface = shellSurface;
}
Component.onCompleted: {
@@ -77,6 +85,11 @@ WaylandCompositor {
}
]
+ onCreateSurface: {
+ var surface = surfaceComponent.createObject(0, { } );
+ surface.initialize(compositor, client, id, version);
+ }
+
Component.onCompleted: {
screenComponent.createObject(0, { "outputSpace" : defaultOutputSpace } );
}