From 6358b0ede93c6633802126bf8bf0a44860e66917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 4 Sep 2015 14:35:19 +0200 Subject: 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 --- examples/wayland/pure-qml/qml/main.qml | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'examples/wayland/pure-qml') 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 } ); } -- cgit v1.2.3