summaryrefslogtreecommitdiffstats
path: root/tests/auto/client/shared/coreprotocol.h
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2020-10-13 01:31:54 +0200
committerAleix Pol <aleixpol@kde.org>2020-10-15 16:13:12 +0200
commit519ca669b08f0bce45d645d271bd1236bdb3970a (patch)
tree1cfaeb9f63e03ed5645ec0b6a1d9026a871b855d /tests/auto/client/shared/coreprotocol.h
parent349d1c03b222a9c30ad7a97a01e66e83b281b7cb (diff)
Implement CoreProtocol::compositor_create_region
Otherwise tests using it crash. Pick-to: 5.15 Change-Id: Id2ce98ed7c975144728be7566e20b6ea08fa9150 Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'tests/auto/client/shared/coreprotocol.h')
-rw-r--r--tests/auto/client/shared/coreprotocol.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/client/shared/coreprotocol.h b/tests/auto/client/shared/coreprotocol.h
index 3670dc641..45f93ec55 100644
--- a/tests/auto/client/shared/coreprotocol.h
+++ b/tests/auto/client/shared/coreprotocol.h
@@ -139,6 +139,21 @@ protected:
void surface_frame(Resource *resource, uint32_t callback) override;
};
+class Region : public QtWaylandServer::wl_region
+{
+public:
+ explicit Region(wl_client *client, int id, int version)
+ : QtWaylandServer::wl_region(client, id, version)
+ {
+ }
+
+ void region_destroy_resource(Resource *resource) override
+ {
+ Q_UNUSED(resource);
+ delete this;
+ }
+};
+
class WlCompositor : public Global, public QtWaylandServer::wl_compositor
{
Q_OBJECT
@@ -162,6 +177,12 @@ protected:
m_surfaces.append(surface);
emit surfaceCreated(surface);
}
+
+ static void compositor_create_region(wl_client *client, wl_resource *compositorResource,
+ uint32_t id)
+ {
+ new Region(client, id, wl_resource_get_version(compositorResource));
+ }
};
class Subsurface : public QObject, public QtWaylandServer::wl_subsurface