summaryrefslogtreecommitdiffstats
path: root/tests/auto/client/shared/coreprotocol.h
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-11-05 07:48:33 +0100
committerJohan Klokkhammer Helsing <johan.helsing@qt.io>2019-11-05 11:35:46 +0100
commitb990f98b44ced37a319d7f476fad7bfb3e070be0 (patch)
tree171a797b6e82a9433e047de7a2ffe475e544a1e8 /tests/auto/client/shared/coreprotocol.h
parentd4ac2c9915fed87193cd2cf7ac438a9fa8edc126 (diff)
parent09474cdf5244ce6fba51a6b01bfe50caf7635c66 (diff)
Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts: src/client/qwaylanddisplay.cpp src/client/qwaylandwindow.cpp Change-Id: I30ddf5305b3087b93cf4d6e562fd0146dea61cc0
Diffstat (limited to 'tests/auto/client/shared/coreprotocol.h')
-rw-r--r--tests/auto/client/shared/coreprotocol.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/auto/client/shared/coreprotocol.h b/tests/auto/client/shared/coreprotocol.h
index fe8202ad1..a12d22d36 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 {