summaryrefslogtreecommitdiffstats
path: root/examples/wayland/pure-qml/qml
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@theqtcompany.com>2015-09-14 16:24:30 +0200
committerPaul Olav Tvete <paul.tvete@theqtcompany.com>2015-09-16 10:35:14 +0000
commitdae5d55dea859bb3a5722bf665d077f1f9b3d360 (patch)
treed08e0906b015add456105a1bc261fdcfba2f8701 /examples/wayland/pure-qml/qml
parente9aa3a9edf63ff0f47f38e73ef20403f7bec1a0d (diff)
Implement resize/move for pure-qml
Change-Id: I7919f7715486fa2d8cfe35c08095f6c33757a515 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Diffstat (limited to 'examples/wayland/pure-qml/qml')
-rw-r--r--examples/wayland/pure-qml/qml/Chrome.qml5
-rw-r--r--examples/wayland/pure-qml/qml/main.qml40
2 files changed, 8 insertions, 37 deletions
diff --git a/examples/wayland/pure-qml/qml/Chrome.qml b/examples/wayland/pure-qml/qml/Chrome.qml
index f52582816..acdb4c65e 100644
--- a/examples/wayland/pure-qml/qml/Chrome.qml
+++ b/examples/wayland/pure-qml/qml/Chrome.qml
@@ -41,9 +41,12 @@
import QtQuick 2.0
import QtWayland.Compositor 1.0
-WaylandQuickItem {
+ShellSurfaceItem {
id: rootChrome
+ shellSurface: ShellSurface {
+ }
+
onSurfaceDestroyed: {
lockedBuffer = true;
destroyAnimation.start();
diff --git a/examples/wayland/pure-qml/qml/main.qml b/examples/wayland/pure-qml/qml/main.qml
index 7f47e1325..d20ea10fd 100644
--- a/examples/wayland/pure-qml/qml/main.qml
+++ b/examples/wayland/pure-qml/qml/main.qml
@@ -60,49 +60,17 @@ WaylandCompositor {
Component {
id: surfaceComponent
WaylandSurface {
- property QtObject shellSurface: null
}
}
extensions: [
- DefaultShell {
+ Shell {
id: defaultShell
- Component {
- id: shellSurfaceComponent
- DefaultShellSurface {
- property Item chrome
- property var previousMousePosition
- property var originalInputEventsEnabled
- Connections {
- target: chrome ? chrome : null
- onMouseMove: {
- var deltaX = windowPosition.x - previousMousePosition.x
- var deltaY = windowPosition.y - previousMousePosition.y
- chrome.x = chrome.x + deltaX
- chrome.y = chrome.y + deltaY
- previousMousePosition = windowPosition;
- }
- onMouseRelease: {
- chrome.inputEventsEnabled = originalInputEventsEnabled;
- }
- }
-
- onStartMove: {
- previousMousePosition = chrome.mousePressPosition
- originalInputEventsEnabled = chrome.inputEventsEnabled
- chrome.inputEventsEnabled = false;
- }
-
- }
- }
onCreateShellSurface: {
var item = chromeComponent.createObject(defaultOutput.surfaceArea, { "surface": surface } );
- var shellSurface = shellSurfaceComponent.createObject( null, { "chrome": item });
- shellSurface.chrome = item;
- shellSurface.initialize(defaultShell, surface, client, id);
- surface.shellSurface = shellSurface;
+ item.shellSurface.initialize(defaultShell, surface, client, id);
}
Component.onCompleted: {
@@ -112,12 +80,12 @@ WaylandCompositor {
]
onCreateSurface: {
- var surface = surfaceComponent.createObject(0, { } );
+ var surface = surfaceComponent.createObject(compositor, { } );
surface.initialize(compositor, client, id, version);
}
Component.onCompleted: {
- screenComponent.createObject(0, { "outputSpace" : defaultOutputSpace } );
+ screenComponent.createObject(compositor, { "outputSpace" : defaultOutputSpace } );
}
}