summaryrefslogtreecommitdiffstats
path: root/examples/wayland
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2017-04-06 10:57:37 +0200
committerJohan Helsing <johan.helsing@qt.io>2018-05-18 09:01:03 +0000
commit458dfb4c65dd959115416a5bc9d6dfc5e4936bd6 (patch)
tree4d08e01fc30f042a52f2d9ecbd47c41d22be37fa /examples/wayland
parent2dd9db479cc0cedc6401e9283d2ad7c3b432a045 (diff)
Compositor: Automatically create ShellSurfaceItems for popups
Change-Id: I5e6b0147c4f1bb73ff3a8f5512d21884f962a89a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'examples/wayland')
-rw-r--r--examples/wayland/minimal-qml/main.qml1
-rw-r--r--examples/wayland/pure-qml/qml/Chrome.qml1
-rw-r--r--examples/wayland/pure-qml/qml/main.qml18
3 files changed, 4 insertions, 16 deletions
diff --git a/examples/wayland/minimal-qml/main.qml b/examples/wayland/minimal-qml/main.qml
index 0f0ca61bc..85c8c5783 100644
--- a/examples/wayland/minimal-qml/main.qml
+++ b/examples/wayland/minimal-qml/main.qml
@@ -67,6 +67,7 @@ WaylandCompositor {
// resize/move, and forwarding of mouse and keyboard
// events to the client process.
ShellSurfaceItem {
+ autoCreatePopupItems: true
shellSurface: modelData
onSurfaceDestroyed: shellSurfaces.remove(index)
}
diff --git a/examples/wayland/pure-qml/qml/Chrome.qml b/examples/wayland/pure-qml/qml/Chrome.qml
index e6fe97476..2e2586c1b 100644
--- a/examples/wayland/pure-qml/qml/Chrome.qml
+++ b/examples/wayland/pure-qml/qml/Chrome.qml
@@ -53,6 +53,7 @@ import QtWayland.Compositor 1.0
ShellSurfaceItem {
id: rootChrome
+ autoCreatePopupItems: true
property bool isChild: parent.shellSurface !== undefined
diff --git a/examples/wayland/pure-qml/qml/main.qml b/examples/wayland/pure-qml/qml/main.qml
index 77ed3ecd9..7bf2a623c 100644
--- a/examples/wayland/pure-qml/qml/main.qml
+++ b/examples/wayland/pure-qml/qml/main.qml
@@ -83,29 +83,15 @@ WaylandCompositor {
}
}
- property variant viewsBySurface: ({})
-
XdgShellV5 {
onXdgSurfaceCreated: {
- var item = chromeComponent.createObject(defaultOutput.surfaceArea, { "shellSurface": xdgSurface } );
- viewsBySurface[xdgSurface.surface] = item;
- }
- onXdgPopupCreated: {
- var parentView = viewsBySurface[xdgPopup.parentSurface];
- var item = chromeComponent.createObject(parentView, { "shellSurface": xdgPopup } );
- viewsBySurface[xdgPopup.surface] = item;
+ chromeComponent.createObject(defaultOutput.surfaceArea, { "shellSurface": xdgSurface } );
}
}
XdgShellV6 {
onToplevelCreated: {
- var item = chromeComponent.createObject(defaultOutput.surfaceArea, { "shellSurface": xdgSurface } );
- viewsBySurface[xdgSurface.surface] = item;
- }
- onPopupCreated: {
- var parentView = viewsBySurface[popup.parentXdgSurface.surface];
- var item = chromeComponent.createObject(parentView, { "shellSurface": xdgSurface } );
- viewsBySurface[xdgSurface.surface] = item;
+ chromeComponent.createObject(defaultOutput.surfaceArea, { "shellSurface": xdgSurface } );
}
}