summaryrefslogtreecommitdiffstats
path: root/tests/auto/client/shared
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-12 03:05:13 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-12 03:05:13 +0100
commit741506eb89a59f960f25706329e7b4d0332c1eb9 (patch)
tree336ae12dcd8ed37f8a789b9ca388c666979a217a /tests/auto/client/shared
parent1a52c4db428e65f4a0b92bea5811014aaa387263 (diff)
parentacddf1834ffa1b256a38919d9626f1e12460b484 (diff)
Merge remote-tracking branch 'origin/5.15' into devHEADdev
Diffstat (limited to 'tests/auto/client/shared')
-rw-r--r--tests/auto/client/shared/coreprotocol.h25
-rw-r--r--tests/auto/client/shared/mockcompositor.h1
2 files changed, 25 insertions, 1 deletions
diff --git a/tests/auto/client/shared/coreprotocol.h b/tests/auto/client/shared/coreprotocol.h
index fe8202ad..a12d22d3 100644
--- a/tests/auto/client/shared/coreprotocol.h
+++ b/tests/auto/client/shared/coreprotocol.h
@@ -164,6 +164,16 @@ protected:
}
};
+class Subsurface : public QObject, public QtWaylandServer::wl_subsurface
+{
+ Q_OBJECT
+public:
+ explicit Subsurface(wl_client *client, int id, int version)
+ : QtWaylandServer::wl_subsurface(client, id, version)
+ {
+ }
+};
+
class SubCompositor : public Global, public QtWaylandServer::wl_subcompositor
{
Q_OBJECT
@@ -171,7 +181,20 @@ public:
explicit SubCompositor(CoreCompositor *compositor, int version = 1)
: QtWaylandServer::wl_subcompositor(compositor->m_display, version)
{}
- // TODO
+ QVector<Subsurface *> m_subsurfaces;
+
+signals:
+ void subsurfaceCreated(Subsurface *subsurface);
+
+protected:
+ void subcompositor_get_subsurface(Resource *resource, uint32_t id, ::wl_resource *surface, ::wl_resource *parent) override
+ {
+ QTRY_VERIFY(parent);
+ QTRY_VERIFY(surface);
+ auto *subsurface = new Subsurface(resource->client(), id, resource->version());
+ m_subsurfaces.append(subsurface); // TODO: clean up?
+ emit subsurfaceCreated(subsurface);
+ }
};
struct OutputMode {
diff --git a/tests/auto/client/shared/mockcompositor.h b/tests/auto/client/shared/mockcompositor.h
index c7d85b95..deef1f90 100644
--- a/tests/auto/client/shared/mockcompositor.h
+++ b/tests/auto/client/shared/mockcompositor.h
@@ -56,6 +56,7 @@ public:
// Convenience functions
Output *output(int i = 0) { return getAll<Output>().value(i, nullptr); }
Surface *surface(int i = 0) { return get<WlCompositor>()->m_surfaces.value(i, nullptr); }
+ Subsurface *subSurface(int i = 0) { return get<SubCompositor>()->m_subsurfaces.value(i, nullptr); }
XdgSurface *xdgSurface(int i = 0) { return get<XdgWmBase>()->m_xdgSurfaces.value(i, nullptr); }
XdgToplevel *xdgToplevel(int i = 0) { return get<XdgWmBase>()->toplevel(i); }
XdgPopup *xdgPopup(int i = 0) { return get<XdgWmBase>()->popup(i); }