summaryrefslogtreecommitdiff
path: root/examples/wayland/pure-qml/qml/main.qml
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@theqtcompany.com>2015-08-24 16:51:01 +0200
committerJørgen Lind <jorgen.lind@theqtcompany.com>2015-08-28 13:10:33 +0200
commitd2d70779224b067f6035f431319036054272ce65 (patch)
tree0ea297990553ff75cf82fb840d59dde903903dcd /examples/wayland/pure-qml/qml/main.qml
parent88f821e189bd1d4d4550c1864f622ca7df2a7c34 (diff)
downloadqtwayland-d2d70779224b067f6035f431319036054272ce65.tar.gz
Make the default wl_shell available from QML
This finaly ties together how to use QWaylandQuickItems with different shells It was required to decouple QWaylandView from the QWaylandQuickItem since QML doesn't play to well with muliple inheritance. The QWaylandQuickItem can be retrieved from the QWaylandView which is now conveniently a QObject. Also the QWaylandQuickItem owns the QWaylandView. This architecture also leaves room for creating a QWaylandWidget :) Change-Id: Ib8a00e6f17f0f1bfc3ff244753f021c76db22cb1
Diffstat (limited to 'examples/wayland/pure-qml/qml/main.qml')
-rw-r--r--examples/wayland/pure-qml/qml/main.qml23
1 files changed, 19 insertions, 4 deletions
diff --git a/examples/wayland/pure-qml/qml/main.qml b/examples/wayland/pure-qml/qml/main.qml
index 18fd45fa..121cb0d2 100644
--- a/examples/wayland/pure-qml/qml/main.qml
+++ b/examples/wayland/pure-qml/qml/main.qml
@@ -44,6 +44,8 @@ import QtWayland.Compositor 1.0
WaylandCompositor {
id: compositor
+ property var primarySurfacesArea: null
+
Component {
id: screenComponent
Screen { }
@@ -54,17 +56,30 @@ WaylandCompositor {
Chrome { }
}
+ extensions: [
+ DefaultShell {
+
+ onShellSurfaceCreated: {
+ var item = chromeComponent.createObject(primarySurfacesArea);
+ item.surface = surface;
+ item.followRequestedPosition = true;
+ shellSurface.view = item.view;
+ }
+
+ Component.onCompleted: {
+ initialize();
+ }
+ }
+ ]
+
Component.onCompleted: {
addScreen();
}
function addScreen() {
var screen = screenComponent.createObject(0, { "compositor" : compositor } );
+ primarySurfacesArea = screen.surfacesArea;
var output = compositor.primaryOutputSpace.addOutputWindow(screen, "", "");
output.automaticFrameCallbacks = true;
}
-
- onSurfaceCreated: {
- var chrome = chromeComponent.createObject(primaryOutputSpace.primaryOutput.window.surfacesArea, { "surface" : surface } );
- }
}