diff options
author | Jørgen Lind <jorgen.lind@theqtcompany.com> | 2015-08-27 12:29:52 +0200 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@theqtcompany.com> | 2015-08-28 13:10:33 +0200 |
commit | c45c1e13c95426116b2b9cc945939bb0b9598079 (patch) | |
tree | ac0b71232e0899b757affa82c19f0086e2ef5098 /examples/wayland/pure-qml/qml | |
parent | c9500b6eff3dc8fbcc6e9fc569b2e246541a2a05 (diff) |
Make it possible to create the shell surface from qml
Change-Id: I83dceff36d1027b24c1dafb3bc44e07f7502bc54
Diffstat (limited to 'examples/wayland/pure-qml/qml')
-rw-r--r-- | examples/wayland/pure-qml/qml/main.qml | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/examples/wayland/pure-qml/qml/main.qml b/examples/wayland/pure-qml/qml/main.qml index 30c7a63bf..642a60325 100644 --- a/examples/wayland/pure-qml/qml/main.qml +++ b/examples/wayland/pure-qml/qml/main.qml @@ -58,11 +58,17 @@ WaylandCompositor { extensions: [ DefaultShell { + id: defaultShell - onShellSurfaceCreated: { - var item = chromeComponent.createObject(primarySurfacesArea); - item.surface = surface; - shellSurface.view = item.view; + Component { + id: shellSurfaceComponent + DefaultShellSurface { } + } + + onCreateShellSurface: { + var item = chromeComponent.createObject(primarySurfacesArea, { "surface": surface } ); + var shellSurface = shellSurfaceComponent.createObject(); + shellSurface.initialize(defaultShell, surface, item.view, client, id); } Component.onCompleted: { @@ -71,14 +77,15 @@ WaylandCompositor { } ] - Component.onCompleted: { - addScreen(); - } - function addScreen() { var screen = screenComponent.createObject(0, { "compositor" : compositor } ); primarySurfacesArea = screen.surfacesArea; var output = compositor.primaryOutputSpace.addOutputWindow(screen, "", ""); output.automaticFrameCallbacks = true; } + + Component.onCompleted: { + addScreen(); + } + } |